Eliminate another unnecessary temp variable

- do all the copying inside a loop
This commit is contained in:
Panu Matilainen 2008-07-16 10:33:57 +03:00
parent 1b19676027
commit 889f9f5b41
1 changed files with 2 additions and 4 deletions

View File

@ -1574,7 +1574,7 @@ rpmExpand(const char *arg, ...)
{
size_t blen = MACROBUFSIZ;
char *buf = NULL;
char *p, *pe;
char *pe;
const char *s;
va_list ap;
@ -1585,11 +1585,9 @@ rpmExpand(const char *arg, ...)
buf = xmalloc(blen);
buf[0] = '\0';
p = buf;
pe = stpcpy(p, arg);
va_start(ap, arg);
while ((s = va_arg(ap, const char *)) != NULL)
for (pe = buf, s = arg; s != NULL; s = va_arg(ap, const char *))
pe = stpcpy(pe, s);
va_end(ap);
(void) expandMacros(NULL, NULL, buf, blen);