#include <string.h>
#include <strings.h>
-char *strptime(const char *s, const char *f, struct tm *tm)
+char *strptime(const char *restrict s, const char *restrict f, struct tm *restrict tm)
{
int i, w, neg, adj, min, range, *dest;
const char *ex;
else if (*s != *f) return 0;
else s++;
f++;
+ continue;
}
f++;
if (*f == '+') f++;
if (*s == '+') s++;
else if (*s == '-') neg=1, s++;
if (!isdigit(*s)) return 0;
- for (i=0; i<w && isdigit(*s); i++)
+ for (*dest=i=0; i<w && isdigit(*s); i++)
*dest = *dest * 10 + *s++ - '0';
if (neg) *dest = -*dest;
*dest -= adj;
ex = nl_langinfo(min+i);
len = strlen(ex);
if (strncasecmp(s, ex, len)) continue;
+ s += len;
*dest = i % range;
break;
}