← Commit list

3bfbce831

Giorgi Tchankvetadze
Giorgi Tchankvetadze
2026-01-18
SUCCESS Duration: 151s

Subject

cmp: stop skipping bytes if EOF is reached

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0
gcc -Wp,-MD,applets/.usage.d -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer      -Iinclude -Iinclude -o applets/usage applets/usage.c

Build Log

(log yok)

Commit Diff GitHub →

editors/cmp.c+2 -2
@@ -113,8 +113,8 @@ int cmp_main(int argc UNUSED_PARAM, char **argv)
fmt = fmt_differ;
if (ENABLE_DESKTOP) {
- while (skip1) { getc(fp1); skip1--; }
- while (skip2) { getc(fp2); skip2--; }
+ while (skip1) { if (getc(fp1) == EOF) break; skip1--; }
+ while (skip2) { if (getc(fp2) == EOF) break; skip2--; }
}
do {
if (max_count >= 0 && --max_count < 0)