Browse Source

Fix Segmentation Fault on FreeBSD 13.0 arm64

strlen was called on a garbage value on the stack, which is wrong,
since it wasn't provided as an argument to the WARN macro.
Nico Sonack 4 years ago
parent
commit
d6c7559ff4
1 changed files with 2 additions and 2 deletions
  1. 2 2
      nobuild.h

+ 2 - 2
nobuild.h

@@ -931,7 +931,7 @@ void path_rm(Cstr path)
 
         if (rmdir(path) < 0) {
             if (errno == ENOENT) {
-                WARN("directory %s does not exist");
+                WARN("directory %s does not exist", path);
             } else {
                 PANIC("could not remove directory %s: %s", path, strerror(errno));
             }
@@ -939,7 +939,7 @@ void path_rm(Cstr path)
     } else {
         if (unlink(path) < 0) {
             if (errno == ENOENT) {
-                WARN("file %s does not exist");
+                WARN("file %s does not exist", path);
             } else {
                 PANIC("could not remove file %s: %s", path, strerror(errno));
             }