diff options
-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; } |