correct signeness of memory bytes
authorLaurent Mazet <mazet@softndesign.org>
Wed, 9 Oct 2024 11:55:53 +0000 (13:55 +0200)
committerLaurent Mazet <mazet@softndesign.org>
Wed, 9 Oct 2024 11:55:53 +0000 (13:55 +0200)
bf.c

diff --git a/bf.c b/bf.c
index 7069e04b81966f41799f159eab0385955f834d3a..aa1ad679a9e056b529066e559c5caf0625e9b8fa 100644 (file)
--- a/bf.c
+++ b/bf.c
@@ -33,7 +33,7 @@
 
 char *progname = NULL;
 int p = 0;
-char mem[MEMSIZE] = {0};
+signed char mem[MEMSIZE] = {0};
 int j = 0;
 int jump[MAXJUMP] = {0};
 
@@ -270,7 +270,7 @@ int main (int argc, char *argv[])
     /* free buffer */
     free (buffer);
 
-    VERBOSE (INFO, fprintf (stdout, "\nmemory:"); int _i; for (_i = 0; _i < MEMSIZE; _i++) fprintf (stdout," %d", mem[_i]); fprintf (stdout,"\n"));
+    VERBOSE (INFO, fprintf (stdout, "\nmemory:"); int _i; for (_i = 0; _i < MEMSIZE; _i++) fprintf (stdout," %d", (int)mem[_i]); fprintf (stdout,"\n"));
 
     return rc;
 }