diff options
author | Mitya Selivanov <automainint@guattari.tech> | 2023-03-27 05:39:50 +0200 |
---|---|---|
committer | Mitya Selivanov <automainint@guattari.tech> | 2023-03-27 05:39:50 +0200 |
commit | bed962a7bc6de0afd3828d991d46525f6b346d32 (patch) | |
tree | 0e0206fb1858c22a69e1b6684b2e9aecede0618f | |
parent | a0974ef8b938c5ee38375fbf7e0af1b97d9ca71e (diff) | |
download | kit-bed962a7bc6de0afd3828d991d46525f6b346d32.zip |
Check for buffer size
-rw-r--r-- | gen_cmake.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gen_cmake.c b/gen_cmake.c index c3bc110..0f11407 100644 --- a/gen_cmake.c +++ b/gen_cmake.c @@ -22,8 +22,8 @@ char const *sz_(str_t const s) { int n = s.size; if (n > 999) n = 999; - memcpy(buf, s.values, s.size); - buf[s.size] = '\0'; + memcpy(buf, s.values, n); + buf[n] = '\0'; return buf; } |