[BusyBox] [PATCH] add optional SKIP arguments to cmp

Vladimir N. Oleynik dzo at simtreas.ru
Wed Mar 17 11:59:19 UTC 2004


Hideki,

>>>+static void skip_input(FILE *fp, unsigned long skip, const char *filename)
>>>+{
>>>+	if (skip > 0 && lseek(fileno(fp), skip, SEEK_CUR) < 0) {
>>
>>You use lseek + getc. Your skiping make double size.
>>
> 
> 
> Why? Getc will be called only when lseek fails.

OOPS. My quick.
But please use off_t type for skip - this recomended for large files.


--w
vodz




More information about the busybox mailing list