This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH][BZ #14888] Use ISSPACE consistently in strptime
- From: Siddhesh Poyarekar <siddhesh at redhat dot com>
- To: libc-alpha at sourceware dot org
- Date: Mon, 15 Apr 2013 18:23:17 +0530
- Subject: [PATCH][BZ #14888] Use ISSPACE consistently in strptime
Hi,
There are a couple of places in strptime where it checks only for
spaces when trying to skip whitespace. Attached patch fixes them. No
regressions in the testsuite. OK to commit?
Siddhesh
[BZ #14888]
* time/strptime_l.c (get_number): Use ISSPACE.
(__strptime_internal): Likewise.
diff --git a/time/strptime_l.c b/time/strptime_l.c
index 89daffa..1f2e8b6 100644
--- a/time/strptime_l.c
+++ b/time/strptime_l.c
@@ -72,7 +72,7 @@ localtime_r (t, tp)
do { \
int __n = n; \
val = 0; \
- while (*rp == ' ') \
+ while (ISSPACE (*rp)) \
++rp; \
if (*rp < '0' || *rp > '9') \
return NULL; \
@@ -752,7 +752,7 @@ __strptime_internal (rp, fmt, tmp, statep LOCALE_PARAM)
also specified. */
{
val = 0;
- while (*rp == ' ')
+ while (ISSPACE (*rp))
++rp;
if (*rp != '+' && *rp != '-')
return NULL;