+2008-05-26 Nicolas François <nicolas.francois@centraliens.net>
+
+ * libmisc/valid.c: Avoid implicit conversion of pointers /chars to
+ booleans.
+ * libmisc/valid.c: Add brackets.
+
2008-05-26 Nicolas François <nicolas.francois@centraliens.net>
* libmisc/yesno.c: yes_or_no returns a bool instead of int.
* routine is meant to waste CPU time.
*/
- if (ent->pw_name && !ent->pw_passwd[0]) {
- if (!password[0])
+ if ((NULL != ent->pw_name) && ('\0' == ent->pw_passwd[0])) {
+ if ('\0' == password[0]) {
return (1); /* user entered nothing */
- else
+ } else {
return (0); /* user entered something! */
+ }
}
/*
* cause non-existent users to not be validated.
*/
- if (ent->pw_name && strcmp (encrypted, ent->pw_passwd) == 0)
+ if ((NULL != ent->pw_name) &&
+ (strcmp (encrypted, ent->pw_passwd) == 0)) {
return (1);
- else
+ } else {
return (0);
+ }
}