From fc184984a013b2fe42df999bce754dfb97fc5d7d Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Apr 2021 15:11:34 +0530 Subject: [PATCH] ... --- kitty/disk-cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kitty/disk-cache.c b/kitty/disk-cache.c index 5c7f43edc..33d5ee0f3 100644 --- a/kitty/disk-cache.c +++ b/kitty/disk-cache.c @@ -85,7 +85,7 @@ static int open_cache_file_without_tmpfile(const char *cache_path) { int fd = -1; static const char *template = "%s/disk-cache-XXXXXXXXXXXX"; - size_t sz = strlen(cache_path) + sizeof(template); + const size_t sz = strlen(cache_path) + sizeof(template) + 4; FREE_AFTER_FUNCTION char *buf = calloc(1, sz); if (!buf) { errno = ENOMEM; return -1; } snprintf(buf, sz - 1, template, cache_path);