aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/time
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-06-14 14:31:59 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-06-14 14:31:59 +0000
commitaee3f8fb6fbacb4223b1c8ce259e3dd875c85031 (patch)
treeb37b8a50a2bd213bee1bbeb5bd82d2cfbf0da5c7 /newlib/libc/time
parent25fa7e5ad63d97d00deef1c9eddb346d1134ba72 (diff)
downloadnewlib-aee3f8fb6fbacb4223b1c8ce259e3dd875c85031.zip
newlib-aee3f8fb6fbacb4223b1c8ce259e3dd875c85031.tar.gz
newlib-aee3f8fb6fbacb4223b1c8ce259e3dd875c85031.tar.bz2
* libc/time/asctime_r.c (asctime_r): Replace call to sprintf with call
to siprintf. * libc/time/strftime.c: Define snprintf to sniprintf in multibyte case. * libc/time/tzset_r.c: Define sscanf to siscanf.
Diffstat (limited to 'newlib/libc/time')
-rw-r--r--newlib/libc/time/asctime_r.c10
-rw-r--r--newlib/libc/time/strftime.c1
-rw-r--r--newlib/libc/time/tzset_r.c2
3 files changed, 8 insertions, 5 deletions
diff --git a/newlib/libc/time/asctime_r.c b/newlib/libc/time/asctime_r.c
index 2c02667..e8abff1 100644
--- a/newlib/libc/time/asctime_r.c
+++ b/newlib/libc/time/asctime_r.c
@@ -18,10 +18,10 @@ _DEFUN (asctime_r, (tim_p, result),
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
- sprintf (result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
- day_name[tim_p->tm_wday],
- mon_name[tim_p->tm_mon],
- tim_p->tm_mday, tim_p->tm_hour, tim_p->tm_min,
- tim_p->tm_sec, 1900 + tim_p->tm_year);
+ siprintf (result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
+ day_name[tim_p->tm_wday],
+ mon_name[tim_p->tm_mon],
+ tim_p->tm_mday, tim_p->tm_hour, tim_p->tm_min,
+ tim_p->tm_sec, 1900 + tim_p->tm_year);
return result;
}
diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c
index 3ab63da..f4704b6 100644
--- a/newlib/libc/time/strftime.c
+++ b/newlib/libc/time/strftime.c
@@ -285,6 +285,7 @@ the "C" locale settings.
# define CQ(a) a /* character constant qualifier */
# define SFLG /* %s flag (null for normal char) */
# define _ctloc(x) (ctloclen = strlen (ctloc = _CurrentTimeLocale->x), ctloc)
+# define snprintf sniprintf /* avoid to pull in FP functions. */
# define TOLOWER(c) tolower((int)(unsigned char)(c))
# define STRTOUL(c,p,b) strtoul((c),(p),(b))
# define STRCPY(a,b) strcpy((a),(b))
diff --git a/newlib/libc/time/tzset_r.c b/newlib/libc/time/tzset_r.c
index 5a5a959..2c5b723 100644
--- a/newlib/libc/time/tzset_r.c
+++ b/newlib/libc/time/tzset_r.c
@@ -7,6 +7,8 @@
#include <sys/time.h>
#include "local.h"
+#define sscanf siscanf /* avoid to pull in FP functions. */
+
static char __tzname_std[11];
static char __tzname_dst[11];
static char *prev_tzenv = NULL;