From 5e14b302bc1200eb364c9967a85dd2b34d737802 Mon Sep 17 00:00:00 2001 From: Themaister Date: Tue, 20 Sep 2011 12:50:13 +0300 Subject: [PATCH] Replace a VLA with char[MAXPATHLEN]. --- file.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/file.c b/file.c index b4556b7b83..dc14bb2eb7 100644 --- a/file.c +++ b/file.c @@ -947,8 +947,8 @@ bool path_file_exists(const char *path) void fill_pathname(char *out_path, const char *in_path, const char *replace, size_t size) { - char tmp_path[strlen(in_path) + 1]; - strlcpy(tmp_path, in_path, sizeof(tmp_path)); + char tmp_path[MAXPATHLEN]; + assert(strlcpy(tmp_path, in_path, sizeof(tmp_path)) < sizeof(tmp_path)); char *tok = strrchr(tmp_path, '.'); if (tok != NULL) *tok = '\0';