sbase

suckless unix tools
git clone git://git.suckless.org/sbase
Log | Files | Refs | README | LICENSE

commit c5a51123b1450a63379dfe19fc35c0a4394132b7
parent 096da1297ba038efeb64acdc85a25b67757f95ad
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 27 Mar 2015 12:21:13 +0100

printf: no need to nul-terminate after strndup

Diffstat:
Mprintf.c | 2--
1 file changed, 0 insertions(+), 2 deletions(-)

diff --git a/printf.c b/printf.c @@ -62,7 +62,6 @@ main(int argc, char *argv[]) for (; strchr("+-0123456789", format[i]); i++); if (j != i) { tmp = estrndup(format + j, i - j); - tmp[i - j] = 0; width = estrtonum(tmp, 0, INT_MAX); free(tmp); } else { @@ -84,7 +83,6 @@ main(int argc, char *argv[]) for (; strchr("+-0123456789", format[i]); i++); if (j != i) { tmp = estrndup(format + j, i - j); - tmp[i - j] = 0; precision = estrtonum(tmp, 0, INT_MAX); free(tmp); } else {