summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-10-08 17:10:26 -0700
committerDan Albert <danalbert@google.com>2014-10-08 17:10:26 -0700
commitca75f9cdeb57d02108924f0ca4043956039e8eaf (patch)
tree8bd5664123e19184cb5b90aea57407cc007344ed /libc
parent72d72d91262fabe6bc169618ef3acb0721441cf0 (diff)
downloadbionic-ca75f9cdeb57d02108924f0ca4043956039e8eaf.zip
bionic-ca75f9cdeb57d02108924f0ca4043956039e8eaf.tar.gz
bionic-ca75f9cdeb57d02108924f0ca4043956039e8eaf.tar.bz2
Use snprintf(3) instead of sprintf(3).
This change should probably be made upstream as well, but they have a note about not using it because it isn't available on all systems. Change-Id: I6d8404c031bd2f486532ced55d94bbb4a4cd2e71
Diffstat (limited to 'libc')
-rw-r--r--libc/tzcode/asctime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/tzcode/asctime.c b/libc/tzcode/asctime.c
index 152b0db..fea24e4 100644
--- a/libc/tzcode/asctime.c
+++ b/libc/tzcode/asctime.c
@@ -103,7 +103,7 @@ asctime_r(register const struct tm *timeptr, char *buf)
/*
** We avoid using snprintf since it's not available on all systems.
*/
- (void) sprintf(result,
+ (void) snprintf(result, sizeof(result), /* Android change: use snprintf. */
((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B),
wn, mn,
timeptr->tm_mday, timeptr->tm_hour,