]> git.earman.xyz Git - sensor-watch.git/commitdiff
fix out of bounds access when position != 0
authorJoey Castillo <joeycastillo@utexas.edu>
Wed, 19 Jan 2022 22:22:31 +0000 (17:22 -0500)
committerJoey Castillo <joeycastillo@utexas.edu>
Wed, 19 Jan 2022 22:22:31 +0000 (17:22 -0500)
watch-library/watch/watch_slcd.c

index 4bcb165287cf30a99c378f95fbf97b285b5c18f0..1b1e53e42616b89045012cec1373cff3835020b8 100644 (file)
@@ -236,7 +236,7 @@ void watch_display_string(char *string, uint8_t position) {
     while(string[i] != 0) {
         watch_display_character(string[i], position + i);
         i++;
-        if (i >= Num_Chars) break;
+        if (position + i >= Num_Chars) break;
     }
     // uncomment this line to see screen output on terminal, i.e.
     //   FR  29