and a fix for it
authorMartin Willi <martin@strongswan.org>
Tue, 1 Apr 2008 14:26:31 +0000 (14:26 -0000)
committerMartin Willi <martin@strongswan.org>
Tue, 1 Apr 2008 14:26:31 +0000 (14:26 -0000)
scripts/bin2array.c

index 015c2bd..4778b44 100644 (file)
@@ -7,7 +7,7 @@
 int main(int argc, char *argv[])
 {
        int i, end = 0;
-       char byte;
+       unsigned char byte;
 
        printf("char %s[] = {\n", argc > 1 ? argv[1] : "data");
        while (1)
@@ -20,7 +20,7 @@ int main(int argc, char *argv[])
                                end = 1;
                                break;
                        }
-                       printf("0x%02x,", byte);
+                       printf("0x%02x,", (unsigned int)byte);
                }
                printf("\n");
                if (end)