diff options
author | rsc <devnull@localhost> | 2006-02-18 15:23:34 +0000 |
---|---|---|
committer | rsc <devnull@localhost> | 2006-02-18 15:23:34 +0000 |
commit | 95456b2155b6f5979d1bf5056506a5b1e27183ee (patch) | |
tree | 3eef70d00b60604fe9f1f46dda8e220de08d3624 | |
parent | 493b97a4d9161bd28d498c3e18b42ca3fc7852b8 (diff) | |
download | plan9port-95456b2155b6f5979d1bf5056506a5b1e27183ee.tar.gz plan9port-95456b2155b6f5979d1bf5056506a5b1e27183ee.tar.bz2 plan9port-95456b2155b6f5979d1bf5056506a5b1e27183ee.zip |
handle 09
-rw-r--r-- | src/cmd/upas/nfs/imap.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cmd/upas/nfs/imap.c b/src/cmd/upas/nfs/imap.c index 80ca59cb..16d11399 100644 --- a/src/cmd/upas/nfs/imap.c +++ b/src/cmd/upas/nfs/imap.c @@ -1009,16 +1009,18 @@ parsedate(Sx *v) warn("bad date: %$", v); return 0; } + + /* cannot use atoi because 09 is malformed octal! */ memset(&tm, 0, sizeof tm); p = v->data; - tm.mday = atoi(p); + tm.mday = strtol(p, 0, 10); tm.mon = parsemon(p+3); if(tm.mon == -1) goto bad; - tm.year = atoi(p+7) - 1900; - tm.hour = atoi(p+12); - tm.min = atoi(p+15); - tm.sec = atoi(p+18); + tm.year = strtol(p+7, 0, 10) - 1900; + tm.hour = strtol(p+12, 0, 10); + tm.min = strtol(p+15, 0, 10); + tm.sec = strtol(p+18, 0, 10); strcpy(tm.zone, "GMT"); t = tm2sec(&tm); |