← Commit list

865814a61

Denys Vlasenko
Denys Vlasenko
2014-09-22
SUCCESS Duration: 150s

Subject

less: trivial code shrink

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

—

Build Log

(log yok)

Commit Diff GitHub →

miscutils/less.c+3 -4
@@ -428,14 +428,13 @@ static void read_lines(void)
w -= 8;
p = current_line = ((char*)xmalloc(w + 4)) + 4;
- max_fline += last_terminated;
if (!last_terminated) {
const char *cp = flines[max_fline];
- strcpy(p, cp);
- p += strlen(current_line);
- free(MEMPTR(flines[max_fline]));
+ p = stpcpy(p, cp);
+ free(MEMPTR(cp));
/* last_line_pos is still valid from previous read_lines() */
} else {
+ max_fline++;
last_line_pos = 0;
}