From 4c173677f51826f78d7553b70e3bf9f98163f1f5 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Tue, 21 Mar 1995 02:24:59 +0000 Subject: (ps_user_passwd) [COUNT, COPY]: Use `if' statement. --- libps/user.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'libps/user.c') diff --git a/libps/user.c b/libps/user.c index b91cc459..b970b89e 100644 --- a/libps/user.c +++ b/libps/user.c @@ -69,7 +69,7 @@ struct passwd *ps_user_passwd(ps_user_t u) { int needed = 0; -#define COUNT(field) (pw->field == NULL || (needed += strlen(pw->field) + 1)) +#define COUNT(field) if (pw->field != NULL) (needed += strlen(pw->field) + 1) COUNT(pw_name); COUNT(pw_passwd); COUNT(pw_gecos); @@ -85,8 +85,8 @@ struct passwd *ps_user_passwd(ps_user_t u) structure and point the fields at that instead of the static storage that pw currently points to. */ #define COPY(field) \ - (pw->field == NULL \ - || (strcpy(p, pw->field), (pw->field = p), (p += strlen(p) + 1))) + if (pw->field != NULL) \ + strcpy(p, pw->field), (pw->field = p), (p += strlen(p) + 1) COPY(pw_name); COPY(pw_passwd); COPY(pw_gecos); -- cgit v1.2.3