OSDN Git Service

Use snprintf instead of sprintf.
authorDan Albert <danalbert@google.com>
Tue, 7 Oct 2014 18:07:53 +0000 (11:07 -0700)
committerDan Albert <danalbert@google.com>
Tue, 7 Oct 2014 18:28:47 +0000 (11:28 -0700)
commitb0fd55608e707b3e9b5c2937537414be7d098afd
treee05263210015392be20269fbeec18b31ec780206
parent81fca35672df90e2f770e67bbf7e7735c6ff8bd8
Use snprintf instead of sprintf.

At -O0, the attribute warning on sprintf is actually triggered (why
doesn't this happen with -Os?!) and promoted to an error by -Werror.
asctime64_r() is a non-standard function, but the IBM docs state that
the buffer is assumed to be at least 26 characters wide, and the
format string does limit to that (assuming a 4 digit year, also
defined by the IBM docs).

http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.bpxbd00/asctimer.htm

Change-Id: I1c884474a769aa16c53e985c3d8d694c478c1189
libc/bionic/time64.c