mirror of
git://git.musl-libc.org/musl
synced 2024-12-17 20:24:54 +00:00
strptime: fix use of uninitialized dest field in converting integer
This commit is contained in:
parent
d2e061a2bd
commit
5989dde345
@ -155,7 +155,7 @@ char *strptime(const char *s, const char *f, struct tm *tm)
|
|||||||
if (*s == '+') s++;
|
if (*s == '+') s++;
|
||||||
else if (*s == '-') neg=1, s++;
|
else if (*s == '-') neg=1, s++;
|
||||||
if (!isdigit(*s)) return 0;
|
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';
|
*dest = *dest * 10 + *s++ - '0';
|
||||||
if (neg) *dest = -*dest;
|
if (neg) *dest = -*dest;
|
||||||
*dest -= adj;
|
*dest -= adj;
|
||||||
|
Loading…
Reference in New Issue
Block a user