embryo - embryo_cc: fix buffer overrun warning
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 9 Nov 2013 01:15:35 +0000 (10:15 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 9 Nov 2013 01:15:35 +0000 (10:15 +0900)
gcc warning was right. it's a pretty smart cookie too.

src/bin/embryo/embryo_cc_sc1.c

index 0340d35cbb8fdf19a91209ee9bbe800d8fa4d987..37e71d4f76dc0dd64988381bd84ef95d51db540f 100644 (file)
@@ -681,7 +681,7 @@ setconfig(char *root)
          }
 
         /* Make sure we have enough space for the trailing DIRSEP_CHAR */
-        if (strlen(path) == sizeof(path) - 1)
+        if (strlen(path) == (sizeof(path) - 1 -1))
           {
              len = strlen(path);
              path[len] = DIRSEP_CHAR;