]> arthur.barton.de Git - netatalk.git/blobdiff - etc/afpd/catsearch.c
Removed C++ comment.
[netatalk.git] / etc / afpd / catsearch.c
index 6ffe6a1504aef1607043c1028769383f3e97377f..bab3591e9bcd0ce65f1dfe06384b9c34ff35c84e 100644 (file)
@@ -174,7 +174,7 @@ static int reducestack()
                        /* Check if we need to free (or release) dir structures */
                } else
                        return dsidx - 1;
-       } // while
+       }
        return -1;
 } /* reducestack() */
 
@@ -408,8 +408,10 @@ static int rslt_add(struct vol *vol, struct stat *statbuf, char *fname, short ci
 
        /* Fill offset of returned file name */
        if (savefname != NULL) {
-               *p++ = 0;
-               *p++ = (int)(p - *rbuf) - 1;
+               *p = 0;
+               p += 1;
+               *p = (int)(p - *rbuf) - 1;
+               p += 1;
                p[0] = l;
                strcpy(p+1, savefname);
                p += l + 1;
@@ -420,7 +422,8 @@ static int rslt_add(struct vol *vol, struct stat *statbuf, char *fname, short ci
 
        *rbuf = p;
        /* *rbuf[0] = (int)(p-*rbuf); */
-       free (savefname);
+       if (savefname != NULL)
+               free (savefname);
        return 1;
 } /* rslt_add */