diff --git a/src/config.c b/src/config.c index 77b796117..9858f22bd 100644 --- a/src/config.c +++ b/src/config.c @@ -856,12 +856,12 @@ load_image_file(char *dest, char *p, uint8_t *ui_wp) prefix = "wp://"; if (path_abs(p)) { - if ((strlen(prefix) + strlen(p)) > (MAX_IMAGE_PATH_LEN - 1)) + if ((strlen(prefix) + strlen(p)) > (MAX_IMAGE_PATH_LEN - 11)) ret = 1; else snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s", prefix, p); } else { - if ((strlen(prefix) + strlen(usr_path) + strlen(path_get_slash(usr_path)) + strlen(p)) > (MAX_IMAGE_PATH_LEN - 1)) + if ((strlen(prefix) + strlen(usr_path) + strlen(path_get_slash(usr_path)) + strlen(p)) > (MAX_IMAGE_PATH_LEN - 11)) ret = 1; else snprintf(dest, MAX_IMAGE_PATH_LEN, "%s%s%s%s", prefix, usr_path, path_get_slash(usr_path), p);