fstk_FindFile checks for sprintf failure

This commit is contained in:
Rangi
2021-04-13 09:31:05 -04:00
parent 3e0b7d428f
commit c0859e64f7

View File

@@ -191,6 +191,11 @@ bool fstk_FindFile(char const *path, char **fullPath, size_t *size)
break; break;
} }
len = sprintf(*fullPath, "%s%s", incPath, path); len = sprintf(*fullPath, "%s%s", incPath, path);
if (len < 0) {
error("sprintf error during include path search: %s\n",
strerror(errno));
break;
}
} }
if (isPathValid(*fullPath)) { if (isPathValid(*fullPath)) {