Check that return value of snprintf(3) is not negative, rather than only -1.
This commit is contained in:
1 parent
84b578b0e4
commit
ab857595d7
2 files changed
+3
-3
No files matched your search
@@ -69,7 +69,7 @@ sanitize_url(const char *path)
|
||||
goto out;
|
||||
|
||||
r = snprintf(buf, sizeof(buf) - 1, "%s/%s", dirnp, basenp);
|
||||
if (r == -1 || r >= (int)sizeof(buf) - 1)
|
||||
if (r < 0 || r >= (int)sizeof(buf) - 1)
|
||||
goto out;
|
||||
|
||||
res = buf;
|
||||
|
||||
Reference in new issue
Block a user