utils: account for terminating \0 byte

parent 8053f98b
...@@ -2384,7 +2384,7 @@ int parse_byte_size_string(const char *s, int64_t *converted) ...@@ -2384,7 +2384,7 @@ int parse_byte_size_string(const char *s, int64_t *converted)
if (!s || !strcmp(s, "")) if (!s || !strcmp(s, ""))
return -EINVAL; return -EINVAL;
end = stpncpy(dup, s, sizeof(dup)); end = stpncpy(dup, s, sizeof(dup) - 1);
if (*end != '\0') if (*end != '\0')
return -EINVAL; return -EINVAL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment