X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=etc%2Fafpd%2Fcatsearch.c;h=6115a4e4c306f068509d9036a91859b5d6565e72;hb=5f5367aa2eedd7e8538566a83d163cc549c9d68f;hp=99636cba6aca95469ebb5015b37de3215c34277e;hpb=56ef10db116a731b4cffdc41ceae813f25b2208a;p=netatalk.git diff --git a/etc/afpd/catsearch.c b/etc/afpd/catsearch.c index 99636cba..6115a4e4 100644 --- a/etc/afpd/catsearch.c +++ b/etc/afpd/catsearch.c @@ -160,7 +160,7 @@ static int addstack(char *uname, struct dir *dir, int pidx) } /* Removes checked items from top of directory stack. Returns index of the first unchecked elements or -1. */ -static int reducestack() +static int reducestack(void) { int r; if (save_cidx != -1) { @@ -180,7 +180,7 @@ static int reducestack() } /* Clears directory stack. */ -static void clearstack() +static void clearstack(void) { save_cidx = -1; while (dsidx > 0) { @@ -422,7 +422,8 @@ static int rslt_add ( struct vol *vol, struct path *path, char **buf, int ext) { char *p = *buf; - int ret, tbuf =0; + int ret; + size_t tbuf =0; u_int16_t resultsize; int isdir = S_ISDIR(path->st.st_mode); @@ -662,8 +663,8 @@ catsearch_end: /* Exiting catsearch: error condition */ } /* catsearch() */ /* -------------------------- */ -int catsearch_afp(AFPObj *obj _U_, char *ibuf, int ibuflen, - char *rbuf, int *rbuflen, int ext) +static int catsearch_afp(AFPObj *obj _U_, char *ibuf, size_t ibuflen, + char *rbuf, size_t *rbuflen, int ext) { struct vol *vol; u_int16_t vid; @@ -735,8 +736,8 @@ int catsearch_afp(AFPObj *obj _U_, char *ibuf, int ibuflen, } /* Parse file specifications */ - spec1 = ibuf; - spec2 = ibuf + spec_len + 2; + spec1 = (unsigned char*)ibuf; + spec2 = (unsigned char*)ibuf + spec_len + 2; spec1 += 2; spec2 += 2; @@ -884,15 +885,15 @@ int catsearch_afp(AFPObj *obj _U_, char *ibuf, int ibuflen, } /* catsearch_afp */ /* -------------------------- */ -int afp_catsearch (AFPObj *obj, char *ibuf, int ibuflen, - char *rbuf, int *rbuflen) +int afp_catsearch (AFPObj *obj, char *ibuf, size_t ibuflen, + char *rbuf, size_t *rbuflen) { return catsearch_afp( obj, ibuf, ibuflen, rbuf, rbuflen, 0); } -int afp_catsearch_ext (AFPObj *obj, char *ibuf, int ibuflen, - char *rbuf, int *rbuflen) +int afp_catsearch_ext (AFPObj *obj, char *ibuf, size_t ibuflen, + char *rbuf, size_t *rbuflen) { return catsearch_afp( obj, ibuf, ibuflen, rbuf, rbuflen, 1); }