=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/patch/inp.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -r1.33 -r1.34 --- src/usr.bin/patch/inp.c 2005/11/14 19:54:10 1.33 +++ src/usr.bin/patch/inp.c 2006/03/11 19:41:30 1.34 @@ -1,4 +1,4 @@ -/* $OpenBSD: inp.c,v 1.33 2005/11/14 19:54:10 miod Exp $ */ +/* $OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $ */ /* * patch - a program to apply diffs to original files @@ -27,7 +27,7 @@ */ #ifndef lint -static const char rcsid[] = "$OpenBSD: inp.c,v 1.33 2005/11/14 19:54:10 miod Exp $"; +static const char rcsid[] = "$OpenBSD: inp.c,v 1.34 2006/03/11 19:41:30 otto Exp $"; #endif /* not lint */ #include @@ -136,11 +136,10 @@ { int ifd, statfailed; char *p, *s, lbuf[MAXLINELEN]; - LINENUM iline; struct stat filestat; off_t i; ptrdiff_t sz; - size_t lines_allocated; + size_t iline, lines_allocated; #ifdef DEBUGGING if (debug & 8) @@ -339,7 +338,7 @@ plan_b(const char *filename) { FILE *ifp; - int i = 0, j, maxlen = 1; + size_t i = 0, j, maxlen = 1; char *p; bool found_revision = (revision == NULL); @@ -439,8 +438,9 @@ else { tiline[whichbuf] = baseline; - lseek(tifd, (off_t) (baseline / lines_per_buf * - BUFFERSIZE), SEEK_SET); + if (lseek(tifd, (off_t) (baseline / lines_per_buf * + BUFFERSIZE), SEEK_SET) < 0) + pfatal("cannot seek in the temporary input file"); if (read(tifd, tibuf[whichbuf], BUFFERSIZE) < 0) pfatal("error reading tmp file %s", TMPINNAME); @@ -456,7 +456,7 @@ rev_in_string(const char *string) { const char *s; - int patlen; + size_t patlen; if (revision == NULL) return true;