--- utils/qzip.c.orig
+++ utils/qzip.c
@@ -469,9 +469,8 @@ int makeOutName(const char *in_name, const char *out_name,
* parent directory. */
void mkPath(char *path, const char *dirpath, char *file)
{
- if (strlen(dirpath) + strlen(file) + 1 < MAX_PATH_LEN) {
- snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, file);
- } else {
+ if (snprintf(path, MAX_PATH_LEN, "%s/%s", dirpath, file) >= MAX_PATH_LEN) {
+ /* truncation occurred */
assert(0);
}
}