提交 5989dde3 编写于 作者: R Rich Felker

strptime: fix use of uninitialized dest field in converting integer

上级 d2e061a2
......@@ -155,7 +155,7 @@ char *strptime(const char *s, const char *f, struct tm *tm)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册