]> git.ipfire.org Git - thirdparty/libsolv.git/commitdiff
Use memcpy instead of strncpy
authorMichael Schroeder <mls@suse.de>
Fri, 26 Jun 2020 13:41:46 +0000 (15:41 +0200)
committerMichael Schroeder <mls@suse.de>
Fri, 26 Jun 2020 13:44:52 +0000 (15:44 +0200)
To silence gcc's warning about "strncpy specified bound depends on
the length of the source argument".

src/repodata.c

index 4e75b6d61a9c4f9019a61e64c1f746501ebefdf4..72f03d4888f0559470cd1026acf9fb978b2dd9c8 100644 (file)
@@ -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 = '/';