From: didg Date: Mon, 2 May 2005 16:34:23 +0000 (+0000) Subject: gcc warnings and rsize use befor init. X-Git-Tag: netatalk-2-0-3~4 X-Git-Url: https://arthur.barton.de/gitweb/?a=commitdiff_plain;h=f555e481d891f1ad5550b9ae584fa6d2b7c9dd13;p=netatalk.git gcc warnings and rsize use befor init. --- diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index 3d95d14b..96e3124e 100644 --- a/etc/afpd/catsearch.c +++ b/etc/afpd/catsearch.c @@ -117,7 +117,7 @@ struct dsitem { #define DS_BSIZE 128 -static int cur_pos = 0; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */ +static u_int32_t cur_pos = 0; /* Saved position index (ID) - used to remember "position" across FPCatSearch calls */ static DIR *dirpos = NULL; /* UNIX structure describing currently opened directory. */ static int save_cidx = -1; /* Saved index of currently scanned directory. */ @@ -484,7 +484,7 @@ static int rslt_add ( struct vol *vol, struct path *path, char **buf, int ext) */ #define NUM_ROUNDS 100 static int catsearch(struct vol *vol, struct dir *dir, - int rmatches, int *pos, char *rbuf, u_int32_t *nrecs, int *rsize, int ext) + int rmatches, u_int32_t *pos, char *rbuf, u_int32_t *nrecs, int *rsize, int ext) { int cidx, r; struct dirent *entry; @@ -499,8 +499,10 @@ static int catsearch(struct vol *vol, struct dir *dir, int num_rounds = NUM_ROUNDS; int cached; - if (*pos != 0 && *pos != cur_pos) - return AFPERR_CATCHNG; + if (*pos != 0 && *pos != cur_pos) { + result = AFPERR_CATCHNG; + goto catsearch_end; + } /* FIXME: Category "offspring count ! */