]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/boot/boot.c
kernel: fix off by one for $cputype buffer (thanks anthony martin)
[plan9front.git] / sys / src / 9 / boot / boot.c
index a8e08f91a3d1c90bf6388e9b7b5b7a496d2336c5..51daee7a05fe7c5c8b8c03c6418a4c3970889272 100644 (file)
@@ -22,7 +22,7 @@ main(int, char *argv[])
        bind(root, "/", MAFTER);
 
        buf[0] = '/';
-       buf[1+read(open("/env/cputype", OREAD|OCEXEC), buf+1, sizeof buf - 5)] = '\0';
+       buf[1+read(open("/env/cputype", OREAD|OCEXEC), buf+1, sizeof buf - 6)] = '\0';
        strcat(buf, bin);
        bind(buf, bin, MAFTER);
        bind("/rc/bin", bin, MAFTER);