xbps-{bin,repo}: strlcpy -> memcpy.

This commit is contained in:
Juan RP
2012-06-18 10:42:24 +02:00
parent a2e42f1d57
commit 3e93d235ff
2 changed files with 7 additions and 9 deletions

View File

@@ -122,13 +122,12 @@ show_pkg_namedesc(struct xbps_handle *xhp,
(strcasestr(pkgver, rsd->patterns[i])) ||
(strcasestr(desc, rsd->patterns[i]))) {
tmp = calloc(1, rsd->pkgver_len + 1);
if (tmp == NULL)
return errno;
strlcpy(tmp, pkgver, rsd->pkgver_len + 1);
assert(tmp);
memcpy(tmp, pkgver, rsd->pkgver_len);
for (x = strlen(tmp); x < rsd->pkgver_len; x++)
tmp[x] = ' ';
tmp[x] = '\0';
printf(" %s %s\n", tmp, desc);
free(tmp);
}