mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
Get rid of bogus holder for realloc(3).
This commit is contained in:
parent
1925cb245c
commit
b9b03ba0bc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=95987
@ -255,10 +255,9 @@ arg1: if (insingle || indouble)
|
||||
*p++ = '\0';
|
||||
*xp++ = argp;
|
||||
if (Iflag) {
|
||||
char *realloc_holder;
|
||||
size_t curlen;
|
||||
realloc_holder = inpline;
|
||||
if (realloc_holder == NULL)
|
||||
|
||||
if (inpline == NULL)
|
||||
curlen = 0;
|
||||
else {
|
||||
/*
|
||||
@ -267,7 +266,7 @@ arg1: if (insingle || indouble)
|
||||
* seperation before the next
|
||||
* argument.
|
||||
*/
|
||||
if (*inpline != '\0')
|
||||
if ((curlen = strlen(inpline)))
|
||||
strcat(inpline, " ");
|
||||
}
|
||||
curlen++;
|
||||
@ -277,8 +276,8 @@ arg1: if (insingle || indouble)
|
||||
* a space next time through, if we have
|
||||
* to.
|
||||
*/
|
||||
inpline = realloc(realloc_holder, strlen(argp) +
|
||||
curlen + 2);
|
||||
inpline = realloc(inpline, curlen + 2 +
|
||||
strlen(argp));
|
||||
if (inpline == NULL)
|
||||
err(1, "realloc");
|
||||
if (curlen == 1)
|
||||
|
Loading…
Reference in New Issue
Block a user