Fixes:
CC src/write_sensu.lo
src/write_sensu.c: In function ‘replace_str’:
src/write_sensu.c:630:3: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation]
strncpy(r, p, strlen(p));
^~~~~~~~~~~~~~~~~~~~~~~~
CCLD write_sensu.la
r += newlen;
p = q + oldlen;
}
r += newlen;
p = q + oldlen;
}
- strncpy(r, p, strlen(p));
+ sstrncpy(r, p, sizeof(r));
return ret;
} /* }}} char *replace_str */
return ret;
} /* }}} char *replace_str */