← Commit list

8ae5b28b4

Denis Vlasenko
Denis Vlasenko
2008-07-02
FAILED Duration: 26s

Subject

awk: another smallish 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 →

editors/awk.c+1 -3
@@ -2028,9 +2028,7 @@ static var *exec_builtin(node *op, var *res)
if (i < 0) i = 0;
n = (nargs > 2) ? getvar_i(av[2]) : l-i;
if (n < 0) n = 0;
- s = xzalloc(n + 1);
- strncpy(s, as[0]+i, n);
- /*s[n] = '\0'; - xzalloc did it */
+ s = xstrndup(as[0]+i, n);
setvar_p(res, s);
break;