diff options
author | jmallett <jmallett@FreeBSD.org> | 2002-06-05 01:32:21 +0000 |
---|---|---|
committer | jmallett <jmallett@FreeBSD.org> | 2002-06-05 01:32:21 +0000 |
commit | 66d6aa72a519c3f24cd893db65df6c3e7bf54c26 (patch) | |
tree | ceb61201413a69b02e522135430f1244bf6d9a41 /bin/ps | |
parent | 739d7b5c19fe937d776793ad5c65b3725e7e3b95 (diff) | |
download | FreeBSD-src-66d6aa72a519c3f24cd893db65df6c3e7bf54c26.zip FreeBSD-src-66d6aa72a519c3f24cd893db65df6c3e7bf54c26.tar.gz |
Use of zero here meant many things, NULL, '\0' (NUL), and 0. Sort it out.
Diffstat (limited to 'bin/ps')
-rw-r--r-- | bin/ps/fmt.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/bin/ps/fmt.c b/bin/ps/fmt.c index 32ed78b..18dee94 100644 --- a/bin/ps/fmt.c +++ b/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++ = ' '; |