]> git.ipfire.org Git - thirdparty/elfutils.git/commit
ar: Fix GCC7 -Wformat-length issues.
authorMark Wielaard <mjw@redhat.com>
Thu, 10 Nov 2016 17:45:02 +0000 (18:45 +0100)
committerMark Wielaard <mjw@redhat.com>
Fri, 11 Nov 2016 12:06:54 +0000 (13:06 +0100)
commitd5afff85e22b38949f3e7936231c67de16e180e8
treed946290b5242ea880351f8bea3fa54f302ed7cfb
parent09ec02ec7f7e6913d10943148e2a898264345b07
ar: Fix GCC7 -Wformat-length issues.

GCC7 adds warnings for snprintf formatting into too small buffers.
Fix the two issues pointed out by the new warning. The ar header
fields are fixed length containing left-justified strings without
zero terminator. snprintf always adds a '\0' char at the end (which
we then don't copy into the ar header field) and numbers are decimal
strings of fixed 10 chars  (-Wformat-length thinks formatting
them as size_t might overflow the buffer on 64bit arches).

Signed-off-by: Mark Wielaard <mjw@redhat.com>
src/ChangeLog
src/ar.c
src/arlib.c