mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Use of zero here meant many things, NULL, '\0' (NUL), and 0. Sort it out.
This commit is contained in:
parent
3600cbb7c4
commit
b69566d8e1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=97845
10
bin/ps/fmt.c
10
bin/ps/fmt.c
@ -81,18 +81,18 @@ shquote(char **argv)
|
||||
errx(1, "malloc failed");
|
||||
}
|
||||
|
||||
if (*argv == 0) {
|
||||
buf[0] = 0;
|
||||
if (*argv == NULL) {
|
||||
buf[0] = '\0';
|
||||
return (buf);
|
||||
}
|
||||
dst = buf;
|
||||
for (p = argv; (src = *p++) != 0; ) {
|
||||
if (*src == 0)
|
||||
for (p = argv; (src = *p++) != NULL; ) {
|
||||
if (*src == '\0')
|
||||
continue;
|
||||
len = (buf_size - 1 - (dst - buf)) / 4;
|
||||
strvisx(dst, src, strlen(src) < len ? strlen(src) : len,
|
||||
VIS_NL | VIS_CSTYLE);
|
||||
while (*dst)
|
||||
while (*dst != '\0')
|
||||
dst++;
|
||||
if ((buf_size - 1 - (dst - buf)) / 4 > 0)
|
||||
*dst++ = ' ';
|
||||
|
Loading…
Reference in New Issue
Block a user