if ((len = PR_Seek(zip->fd, 0, SEEK_END)) == -1) {
if ((len = PR_Seek(zip->fd, 0, PR_SEEK_END)) == -1) {
nsZipFindEnd(ns_zip_t *zip, char *endbuf){    char buf[INBUFSIZ+SIGSIZ], *bp;    PRUint32 len, off, mark;    /* Need to search backwards from end of file */    if ((len = PR_Seek(zip->fd, 0, SEEK_END)) == -1) {#if !defined(XP_PC) || defined(_WIN32)	/*	 * perror is not defined for win16	 */	perror(zip->fn);#endif	return PR_FALSE;    }    /*     * Set limit on how far back we need to search. The END header must be     * located within the last 64K bytes of the file.     */    mark = max(0, len - 0xffff);    /*     * Search backwards INBUFSIZ bytes at a time from end of file stopping     * when the END header signature has been found. Since the signature     * may straddle a buffer boundary, we need to stash the first SIGSIZ-1     * bytes of the previous record at the tail of the current record so     * that the search can overlap.     */    memset(buf, 0, SIGSIZ);    for (off = len; off > mark; ) {	long n = min(off - mark, INBUFSIZ);	memcpy(buf + n, buf, SIGSIZ);	if (PR_Seek(zip->fd, off -= n, SEEK_SET) == -1) {#if !defined(XP_PC) || defined(_WIN32)	/*	 * perror is not defined for win16	 */	    perror(zip->fn);#endif	    return PR_FALSE;	}	if (!nsZipReadFully(zip->fd, buf, n)) {	    ns_ziperr(zip, "Fatal read error while searching for END record");	    return PR_FALSE;	}	for (bp = buf + n - 1; bp >= buf; --bp) {	    if (strncmp(bp, ENDSIG, SIGSIZ) == 0) {		long endoff = off + (long)bp - (long)buf;		if (len - endoff < ENDHDRSIZ) {		    continue;		}		if ((buf+n-bp) >= ENDHDRSIZ) {		    memcpy(endbuf, bp, ENDHDRSIZ);		} else {		    if (PR_Seek(zip->fd, endoff, SEEK_SET) == -1) {#if !defined(XP_PC) || defined(_WIN32)	/*	 * perror is not defined for win16	 */ 		    perror(zip->fn);#endif		    }		    if (!nsZipReadFully(zip->fd, endbuf, ENDHDRSIZ)) {			ns_ziperr(zip, "Read error while searching for END record");			return PR_FALSE;		    }		}		if (endoff + ENDHDRSIZ + ENDCOM(endbuf) != len) {		    continue;		}		if (PR_Seek(zip->fd, endoff, SEEK_SET) == -1) {#if !defined(XP_PC) || defined(_WIN32)	/*	 * perror is not defined for win16	 */		    perror(zip->fn);#endif		    return PR_FALSE;		}		zip->endoff = endoff;		return PR_TRUE;	    }	}    }    return PR_FALSE;}