#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. */
*/
#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;
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 ! */