summaryrefslogtreecommitdiffstats
path: root/bin/ps/ps.c
diff options
context:
space:
mode:
authorgad <gad@FreeBSD.org>2004-06-01 18:12:04 +0000
committergad <gad@FreeBSD.org>2004-06-01 18:12:04 +0000
commit3f104e9ea11ed819cdae798619a3d2bf96a838f7 (patch)
tree00e490a3f7d7bb6c4e76f60570c848ed2d3edccd /bin/ps/ps.c
parentad1b692494d1edda81bf02287d6e275160176f22 (diff)
downloadFreeBSD-src-3f104e9ea11ed819cdae798619a3d2bf96a838f7.zip
FreeBSD-src-3f104e9ea11ed819cdae798619a3d2bf96a838f7.tar.gz
Make a few style-istic improvements to the previous commits.
Noticed by: bde
Diffstat (limited to 'bin/ps/ps.c')
-rw-r--r--bin/ps/ps.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/bin/ps/ps.c b/bin/ps/ps.c
index 90c28af..52ecbed 100644
--- a/bin/ps/ps.c
+++ b/bin/ps/ps.c
@@ -140,7 +140,7 @@ static const char *
KINFO *, char *, int);
static void free_list(struct listinfo *);
static void init_list(struct listinfo *, addelem_rtn, int, const char *);
-static char *kludge_oldps_options(const char *opts, char *, const char *);
+static char *kludge_oldps_options(const char *, char *, const char *);
static int pscomp(const void *, const void *);
static void saveuser(KINFO *);
static void scanvars(void);
@@ -678,20 +678,20 @@ addelem_pid(struct listinfo *inf, const char *elem)
warnx("Invalid (zero-length) process id");
optfatal = 1;
return (0); /* Do not add this value. */
- } else {
- errno = 0;
- tempid = strtol(elem, &endp, 10);
- if (*endp != '\0' || tempid < 0 || elem == endp) {
- warnx("Invalid %s: %s", inf->lname, elem);
- errno = ERANGE;
- } else if (errno != 0 || tempid > BSD_PID_MAX) {
- warnx("%s too large: %s", inf->lname, elem);
- errno = ERANGE;
- }
- if (errno == ERANGE) {
- optfatal = 1;
- return (0); /* Do not add this value. */
- }
+ }
+
+ errno = 0;
+ tempid = strtol(elem, &endp, 10);
+ if (*endp != '\0' || tempid < 0 || elem == endp) {
+ warnx("Invalid %s: %s", inf->lname, elem);
+ errno = ERANGE;
+ } else if (errno != 0 || tempid > BSD_PID_MAX) {
+ warnx("%s too large: %s", inf->lname, elem);
+ errno = ERANGE;
+ }
+ if (errno == ERANGE) {
+ optfatal = 1;
+ return (0); /* Do not add this value. */
}
if (inf->count >= inf->maxcount)
@@ -791,7 +791,6 @@ add_list(struct listinfo *inf, const char *argp)
if (*argp == 0)
inf->addelem(inf, elemcopy);
-
while (*argp != '\0') {
while (*argp != '\0' && strchr(W_SEP, *argp) != NULL)
argp++;
OpenPOWER on IntegriCloud