aboutsummaryrefslogtreecommitdiffhomepage
path: root/Cart_Reader/COLV.ino
diff options
context:
space:
mode:
authorsanni <[email protected]>2022-08-03 19:48:12 +0200
committersanni <[email protected]>2022-08-03 19:48:12 +0200
commit5012ca88ac2b7d63026db039a7b6673143740640 (patch)
tree693571e3f504df4b77aef19da0cf044639b12a31 /Cart_Reader/COLV.ino
parentb5bff8c1f09b4d8d096be8fe70ed80c4af419d1a (diff)
downloadcartreader-5012ca88ac2b7d63026db039a7b6673143740640.tar.gz
cartreader-5012ca88ac2b7d63026db039a7b6673143740640.zip
Fix crash
Diffstat (limited to 'Cart_Reader/COLV.ino')
-rw-r--r--Cart_Reader/COLV.ino8
1 files changed, 6 insertions, 2 deletions
diff --git a/Cart_Reader/COLV.ino b/Cart_Reader/COLV.ino
index bea4321..a86878b 100644
--- a/Cart_Reader/COLV.ino
+++ b/Cart_Reader/COLV.ino
@@ -460,7 +460,10 @@ void setCart_COL() {
else if (b == 2) {
for (byte count_newline = 0; count_newline < 7; count_newline++) {
while (1) {
- if (myFile.peek() == '\n') {
+ if (myFile.curPosition() == 0) {
+ break;
+ }
+ else if (myFile.peek() == '\n') {
myFile.seekSet(myFile.curPosition() - 1);
break;
}
@@ -469,7 +472,8 @@ void setCart_COL() {
}
}
}
- myFile.seekSet(myFile.curPosition() + 2);
+ if (myFile.curPosition() != 0)
+ myFile.seekSet(myFile.curPosition() + 2);
break;
}