diff options
author | Ondrej Filip <feela@network.cz> | 2004-07-01 15:01:26 +0000 |
---|---|---|
committer | Ondrej Filip <feela@network.cz> | 2004-07-01 15:01:26 +0000 |
commit | 02ad2737fd24573d870a5009a624c9b3c49aa176 (patch) | |
tree | 7753e121581f96d478328c7768bda7011b4a85d9 | |
parent | bc4ea680cea9eca46cd2c5f41db91c3014f90167 (diff) |
Password WALK_LIST bugfix.
-rw-r--r-- | nest/password.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/nest/password.c b/nest/password.c index 63096023..0bc38f10 100644 --- a/nest/password.c +++ b/nest/password.c @@ -18,10 +18,13 @@ password_find(list *l) { struct password_item *pi; - WALK_LIST(pi, *l) + if (l) { - if ((pi->genfrom > now) && (pi->gento < now)) - return pi; + WALK_LIST(pi, *l) + { + if ((pi->genfrom > now) && (pi->gento < now)) + return pi; + } } return NULL; } @@ -29,6 +32,6 @@ password_find(list *l) void password_cpy(char *dst, char *src, int size) { bzero(dst, size); - memcpy(dst, src, strlen(src) < size ? strlen(src) : size); + memcpy(dst, src, strlen(src) < (unsigned) size ? strlen(src) : (unsigned) size); } |