aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-03-16 02:07:49 -0400
committerMike Frysinger <vapier@gentoo.org>2014-03-16 02:07:49 -0400
commit8f59ad7b9e732fa41f29c9c23ea42f68546d32ec (patch)
treefcc472ca1642cae935f779b56ab8d7e0b798fa6a /qlist.c
parenttests: qdepends: add a -Q test (diff)
downloadportage-utils-8f59ad7b9e732fa41f29c9c23ea42f68546d32ec.tar.gz
portage-utils-8f59ad7b9e732fa41f29c9c23ea42f68546d32ec.tar.bz2
portage-utils-8f59ad7b9e732fa41f29c9c23ea42f68546d32ec.zip
qlist: speed up -U flag slightly
No need to clear the whole buffer when we use this as a normal C string.
Diffstat (limited to 'qlist.c')
-rw-r--r--qlist.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/qlist.c b/qlist.c
index 0b0714e..fa5e652 100644
--- a/qlist.c
+++ b/qlist.c
@@ -56,7 +56,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV)
if ((use = grab_vdb_item("USE", CAT, PV)) == NULL)
return NULL;
- memset(umap, 0, sizeof(umap)); /* reset the buffer */
+ umap[0] = '\0'; /* reset the buffer */
/* grab_vdb is a static function so save it to memory right away */
makeargv(use, &use_argc, &use_argv);
@@ -85,8 +85,7 @@ static char *grab_pkg_umap(const char *CAT, const char *PV)
sets = del_set(use_argv[i], sets, &ok);
sets = add_set(use_argv[i], use_argv[i], sets);
}
- memset(umap, 0, sizeof(umap)); /* reset the buffer */
- strcpy(umap, "");
+ umap[0] = '\0'; /* reset the buffer */
for (ll = sets; ll != NULL; ll = ll->next) {
strncat(umap, ll->name, sizeof(umap)-strlen(umap)-1);
strncat(umap, " ", sizeof(umap)-strlen(umap)-1);