summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1995-03-21 02:24:59 +0000
committerMichael I. Bushnell <mib@gnu.org>1995-03-21 02:24:59 +0000
commit4c173677f51826f78d7553b70e3bf9f98163f1f5 (patch)
tree659a2f9871526bf5ee4663d62be6e2fe064bb76a
parent5245408b65d8ae94c156c56c7f36417adac95ee4 (diff)
(ps_user_passwd) [COUNT, COPY]: Use `if' statement.
-rw-r--r--libps/user.c6
1 files changed, 3 insertions, 3 deletions
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);