From: Michael Schroeder Date: Fri, 26 Jun 2020 13:41:46 +0000 (+0200) Subject: Use memcpy instead of strncpy X-Git-Tag: 0.7.15~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac194e6f024420c0be72c49def6a80adc33dd4bf;p=thirdparty%2Flibsolv.git Use memcpy instead of strncpy To silence gcc's warning about "strncpy specified bound depends on the length of the source argument". --- diff --git a/src/repodata.c b/src/repodata.c index 4e75b6d6..72f03d48 100644 --- a/src/repodata.c +++ b/src/repodata.c @@ -388,7 +388,7 @@ repodata_dir2str(Repodata *data, Id did, const char *suf) comps = stringpool_id2str(data->localpool ? &data->spool : &pool->ss, comp); l = strlen(comps); p -= l; - strncpy(p, comps, l); + memcpy(p, comps, l); parent = dirpool_parent(&data->dirpool, parent); if (parent) *--p = '/';