fleaks.c: initialize command buffer before calling system

This commit is contained in:
Gavin Hayes 2023-10-01 23:56:20 -04:00
parent cc8c56e814
commit ac06045aed

View file

@ -47,10 +47,11 @@ void CheckForFileLeaks(void) {
} }
} }
if (gotsome) { if (gotsome) {
char proc[64];
*p++ = '\n'; *p++ = '\n';
*p = 0; *p = 0;
write(2, msg, p - msg); write(2, msg, p - msg);
char proc[64];
p = proc;
p = stpcpy(p, "ls -hal /proc/"); p = stpcpy(p, "ls -hal /proc/");
p = FormatInt32(p, getpid()); p = FormatInt32(p, getpid());
p = stpcpy(p, "/fd"); p = stpcpy(p, "/fd");