From 0cfb376070a4bef7b4168a9795e025437e1be79f Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 21 Oct 2012 11:25:08 -0400 Subject: fix clang warnings reported by Tuncer Ayaz R=rsc http://codereview.appspot.com/6744054 --- src/lib9/zoneinfo.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/lib9/zoneinfo.c') 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; -- cgit v1.2.3