From: Ondrej Filip Date: Thu, 1 Jul 2004 15:01:26 +0000 (+0000) Subject: Password WALK_LIST bugfix. X-Git-Tag: v1.2.0~274 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=02ad2737fd24573d870a5009a624c9b3c49aa176;p=thirdparty%2Fbird.git Password WALK_LIST bugfix. --- diff --git a/nest/password.c b/nest/password.c index 630960236..0bc38f108 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); }