am 8a7f8387: Merge "Use snprintf(3) instead of sprintf(3)."

* commit '8a7f8387b3b95de2ee0c42e34a226a1fcc066896':
  Use snprintf(3) instead of sprintf(3).
This commit is contained in:
Dan Albert 2014-10-09 00:39:27 +00:00 committed by Android Git Automerger
commit 653f30b15a

View File

@ -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. ** 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), ((strlen(year) <= 4) ? ASCTIME_FMT : ASCTIME_FMT_B),
wn, mn, wn, mn,
timeptr->tm_mday, timeptr->tm_hour, timeptr->tm_mday, timeptr->tm_hour,