From 59774c5d8b1c7e648e87cb561cac4ed7d7315868 Mon Sep 17 00:00:00 2001 From: didg Date: Mon, 2 May 2005 16:31:24 +0000 Subject: [PATCH] gcc warning and rsize use before init. --- etc/afpd/catsearch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index 2900175b..73dd30a8 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. */ @@ -486,7 +486,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; @@ -501,8 +501,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 ! */ -- 2.39.2