aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/zoneinfo.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@swtch.com>2012-10-21 11:25:08 -0400
committerRuss Cox <rsc@swtch.com>2012-10-21 11:25:08 -0400
commit0cfb376070a4bef7b4168a9795e025437e1be79f (patch)
tree9cea2b3befd9183d11ccc0745a81658d5956e4d7 /src/lib9/zoneinfo.c
parent34d629c8572518afe0a1d5698d7b184938e35a8f (diff)
downloadplan9port-0cfb376070a4bef7b4168a9795e025437e1be79f.tar.gz
plan9port-0cfb376070a4bef7b4168a9795e025437e1be79f.tar.bz2
plan9port-0cfb376070a4bef7b4168a9795e025437e1be79f.zip
fix clang warnings reported by Tuncer Ayaz
R=rsc http://codereview.appspot.com/6744054
Diffstat (limited to 'src/lib9/zoneinfo.c')
-rw-r--r--src/lib9/zoneinfo.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lib9/zoneinfo.c b/src/lib9/zoneinfo.c
index f49d8120..91f1885a 100644
--- a/src/lib9/zoneinfo.c
+++ b/src/lib9/zoneinfo.c
@@ -36,7 +36,7 @@ readtzfile(char *file)
fd = open(file, OREAD);
if (fd<0)
return nil;
- d = dirfstat(fd);
+ d = dirfstat(fd);
if (d==nil)
return nil;
p = malloc(d->length);
@@ -118,21 +118,19 @@ readtimezone(void)
char *tmp;
z.timecnt = 0;
- switch (zonefile==nil) {
- default:
+ if(zonefile==nil) {
if ((tmp=getenv("timezone"))!=nil) {
tzdata = readtzfile(tmp);
free(tmp);
- break;
+ goto havedata;
}
zonefile = "/etc/localtime";
- /* fall through */
- case 0:
- tzdata = readtzfile(zonefile);
}
+ tzdata = readtzfile(zonefile);
if (tzdata==nil)
return;
+havedata:
if (strncmp("TZif", (char*)tzdata, 4)!=0)
goto errfree;