Code Review:
https://review.source.android.com/#change,23997
From afd989ca9f3415df9807847745e854522866f66f Mon Sep 17 00:00:00 2001
From: Jim Huang <[email protected]>
Date: Thu, 16 Jun 2011 22:35:16 +0800
Subject: [PATCH 1/2] strftime: Use snprintf() instead of sprintf()
Change-Id: I112ac012894eddc96e5f3e77cb87bb300596e3ce
---
libc/tzcode/strftime.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libc/tzcode/strftime.c b/libc/tzcode/strftime.c
index ab713fb..d35d58a 100644
--- a/libc/tzcode/strftime.c
+++ b/libc/tzcode/strftime.c
@@ -407,9 +407,9 @@ label:
tm = *t;
mkt = mktime64(&tm);
if (TYPE_SIGNED(time64_t))
- (void) sprintf(buf, "%lld",
+ (void) snprintf(buf, "%lld", sizeof(buf),
(long long) mkt);
- else (void) sprintf(buf, "%llu",
+ else (void) snprintf(buf, "%llu", sizeof(buf),
(unsigned long long) mkt);
pt = _add(buf, pt, ptlim, modifier);
}
--
1.7.5.4
_______________________________________________
linaro-dev mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/linaro-dev