summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--usr.bin/mail/aux.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c
index 401399ace2ef..d8c32b3fb8a3 100644
--- a/usr.bin/mail/aux.c
+++ b/usr.bin/mail/aux.c
@@ -494,9 +494,9 @@ skin(name)
*cp2++ = ' ';
}
*cp2++ = c;
- if (c == ',' && !gotlt) {
+ if (c == ',' && *cp == ' ' && !gotlt) {
*cp2++ = ' ';
- for (; *cp == ' '; cp++)
+ while (*++cp == ' ')
;
lastsp = 0;
bufend = cp2;
@@ -505,8 +505,8 @@ skin(name)
}
*cp2 = '\0';
- if ((nbuf = realloc(nbuf, strlen(nbuf) + 1)) == NULL)
- err(1, "Out of memory");
+ if ((cp = realloc(nbuf, strlen(nbuf) + 1)) != NULL)
+ nbuf = cp;
return (nbuf);
}