From a98dd21d5f02e42d66bdd19531580000647322e8 Mon Sep 17 00:00:00 2001 From: wollman Date: Wed, 25 Nov 2009 04:45:45 +0000 Subject: Eliminate more dead stores. Found by: Clang static analyzer MFC after: 7 days --- lib/libc/gen/getcap.c | 5 ++--- lib/libc/gen/getusershell.c | 2 +- lib/libc/gen/wordexp.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) (limited to 'lib/libc/gen') diff --git a/lib/libc/gen/getcap.c b/lib/libc/gen/getcap.c index 32d66d48..2700d3d 100644 --- a/lib/libc/gen/getcap.c +++ b/lib/libc/gen/getcap.c @@ -647,7 +647,7 @@ int cgetnext(char **bp, char **db_array) { size_t len; - int done, hadreaderr, i, savederrno, status; + int done, hadreaderr, savederrno, status; char *cp, *line, *rp, *np, buf[BSIZE], nbuf[BSIZE]; u_int dummy; @@ -658,7 +658,7 @@ cgetnext(char **bp, char **db_array) (void)cgetclose(); return (-1); } - for(;;) { + for (;;) { if (toprec && !gottoprec) { gottoprec = 1; line = toprec; @@ -709,7 +709,6 @@ cgetnext(char **bp, char **db_array) /* * Line points to a name line. */ - i = 0; done = 0; np = nbuf; for (;;) { diff --git a/lib/libc/gen/getusershell.c b/lib/libc/gen/getusershell.c index b0da2a1..d09b50c 100644 --- a/lib/libc/gen/getusershell.c +++ b/lib/libc/gen/getusershell.c @@ -124,7 +124,7 @@ _local_initshells(rv, cb_data, ap) if ((fp = fopen(_PATH_SHELLS, "r")) == NULL) return NS_UNAVAIL; - sp = cp = line; + cp = line; while (fgets(cp, MAXPATHLEN + 1, fp) != NULL) { while (*cp != '#' && *cp != '/' && *cp != '\0') cp++; diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index 06abdc7..bcab1f5 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -320,7 +320,7 @@ we_check(const char *words, int flags) if (c == '\0' || level != 0) return (WRDE_SYNTAX); } else - c = *--words; + --words; break; default: break; -- cgit v1.1