aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2022-09-23 11:25:18 -0700
committerChris Robinson <[email protected]>2022-09-23 11:25:18 -0700
commit839f960b4d303c92bcfefeb8fbb37e40136db2c3 (patch)
tree8430551f0b5c3ffb01af3fa46236f8f283b58b03 /common
parentcb679f9e89650dee3a26f285c8d3a4d32494af6e (diff)
Avoid another potential overflow
Diffstat (limited to 'common')
-rw-r--r--common/win_main_utf8.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/common/win_main_utf8.h b/common/win_main_utf8.h
index 2f83560b..077af533 100644
--- a/common/win_main_utf8.h
+++ b/common/win_main_utf8.h
@@ -44,7 +44,7 @@ static FILE *my_fopen(const char *fname, const char *mode)
}
#ifdef __cplusplus
- auto strbuf = std::make_unique<wchar_t[]>(static_cast<size_t>(namelen+modelen));
+ auto strbuf = std::make_unique<wchar_t[]>(static_cast<size_t>(namelen)+modelen);
wname = strbuf.get();
#else
wname = (wchar_t*)calloc(sizeof(wchar_t), (size_t)namelen + modelen);