Re: [PATCH] ar: Check whether ar header values fit.

2017-09-20 Thread Mark Wielaard
On Fri, 2017-09-15 at 13:14 +0200, Mark Wielaard wrote: > When compiling with -O3 gcc finds an interesting error: > > src/ar.c: In function ‘do_oper_insert’: > src/ar.c:1077:56: error: ‘%-*ld’ directive output may be truncated > writing between 6 and 10 bytes into a region of size 7 [- > Werror=fo

[PATCH] ar: Check whether ar header values fit.

2017-09-15 Thread Mark Wielaard
When compiling with -O3 gcc finds an interesting error: src/ar.c: In function ‘do_oper_insert’: src/ar.c:1077:56: error: ‘%-*ld’ directive output may be truncated writing between 6 and 10 bytes into a region of size 7 [-Werror=format-truncation=] snprintf (tmpbuf, sizeof (tmpbuf), ofmt ? "%-*l