initd: fix off-by-one error in mkdev.c
[project/procd.git] / initd / mkdev.c
index 44101aa12df5e5a102b626d2eb41f1a10a40e2ad..f0a1e84fc4dec585bb80be591662ca69c3bc291a 100644 (file)
@@ -82,7 +82,7 @@ static void find_devs(bool block)
                        continue;
 
                strcpy(path, dp->d_name);
-               len = readlink(buf2, buf, sizeof(buf));
+               len = readlink(buf2, buf, sizeof(buf) - 1);
                if (len <= 0)
                        continue;