summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1999-11-30 08:11:13 +0000
committerache <ache@FreeBSD.org>1999-11-30 08:11:13 +0000
commit6219664f076ec12bbe553606ea50dc99d637ae6b (patch)
tree8907002d2de74846c4f5b0705ae46cda90af13f5
parent228a52df6fbe55b20039947ab11297e75162e903 (diff)
downloadFreeBSD-src-6219664f076ec12bbe553606ea50dc99d637ae6b.zip
FreeBSD-src-6219664f076ec12bbe553606ea50dc99d637ae6b.tar.gz
Stricter checking %A vs %a
-rw-r--r--lib/libc/stdtime/strptime.c24
1 files changed, 13 insertions, 11 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index d92430a..687cafa 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -281,17 +281,19 @@ label:
case 'A':
case 'a':
for (i = 0; i < asizeof(Locale->weekday); i++) {
- len = strlen(Locale->weekday[i]);
- if (strncasecmp(buf,
- Locale->weekday[i],
- len) == 0)
- break;
-
- len = strlen(Locale->wday[i]);
- if (strncasecmp(buf,
- Locale->wday[i],
- len) == 0)
- break;
+ if (c == 'A') {
+ len = strlen(Locale->weekday[i]);
+ if (strncasecmp(buf,
+ Locale->weekday[i],
+ len) == 0)
+ break;
+ } else {
+ len = strlen(Locale->wday[i]);
+ if (strncasecmp(buf,
+ Locale->wday[i],
+ len) == 0)
+ break;
+ }
}
if (i == asizeof(Locale->weekday))
return 0;
OpenPOWER on IntegriCloud