about summary refs log tree commit diff
path: root/src/time/strptime.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2011-09-05 15:39:36 -0400
committerRich Felker <dalias@aerifal.cx>2011-09-05 15:39:36 -0400
commit5989dde3459b2ccd304f89e3e875136e5608b8ff (patch)
tree1fcb8102f14acefdedb5c1e5700b33560ae6d345 /src/time/strptime.c
parentd2e061a2bd3f7674cfef2e2217e0695419041b5e (diff)
downloadmusl-5989dde3459b2ccd304f89e3e875136e5608b8ff.tar.gz
musl-5989dde3459b2ccd304f89e3e875136e5608b8ff.tar.xz
musl-5989dde3459b2ccd304f89e3e875136e5608b8ff.zip
strptime: fix use of uninitialized dest field in converting integer
Diffstat (limited to 'src/time/strptime.c')
-rw-r--r--src/time/strptime.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/time/strptime.c b/src/time/strptime.c
index d9481d1b..488c08dd 100644
--- a/src/time/strptime.c
+++ b/src/time/strptime.c
@@ -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;