For util functions called with a buffer and length parameter we should
use strlcpy() instead of strncpy(), as those functions are called with
sizeof(buffer) as parameter.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
char *newline = strtok(line, "\n");
if (newline != NULL) {
- strncpy(out, newline, len);
+ strlcpy(out, newline, len);
return out;
}
if (i++ < offset)
continue;
- strncpy(out, &sep[1], len);
- out[len-1] = 0;
+ strlcpy(out, &sep[1], len);
return out;
}