summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>2009-11-25 04:45:45 +0000
committerwollman <wollman@FreeBSD.org>2009-11-25 04:45:45 +0000
commita98dd21d5f02e42d66bdd19531580000647322e8 (patch)
tree01f0d0420123a2fbc4530d2d7bd607cbf6ee8049 /lib
parent0bb16760a11c0384ebde0564be95b7c5711ce69e (diff)
downloadFreeBSD-src-a98dd21d5f02e42d66bdd19531580000647322e8.zip
FreeBSD-src-a98dd21d5f02e42d66bdd19531580000647322e8.tar.gz
Eliminate more dead stores.
Found by: Clang static analyzer MFC after: 7 days
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/getcap.c5
-rw-r--r--lib/libc/gen/getusershell.c2
-rw-r--r--lib/libc/gen/wordexp.c2
-rw-r--r--lib/libc/rpc/getnetconfig.c4
-rw-r--r--lib/libc/rpc/key_call.c2
-rw-r--r--lib/libc/stdio/fgetws.c2
-rw-r--r--lib/libc/yp/yplib.c2
7 files changed, 9 insertions, 10 deletions
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;
diff --git a/lib/libc/rpc/getnetconfig.c b/lib/libc/rpc/getnetconfig.c
index 9baa224..e5db51a 100644
--- a/lib/libc/rpc/getnetconfig.c
+++ b/lib/libc/rpc/getnetconfig.c
@@ -412,13 +412,13 @@ void *handlep;
* Noone needs these entries anymore, then frees them.
* Make sure all info in netconfig_info structure has been reinitialized.
*/
- q = p = ni.head;
+ q = ni.head;
ni.eof = ni.ref = 0;
ni.head = NULL;
ni.tail = NULL;
mutex_unlock(&ni_lock);
- while (q) {
+ while (q != NULL) {
p = q->next;
if (q->ncp->nc_lookups != NULL) free(q->ncp->nc_lookups);
free(q->ncp);
diff --git a/lib/libc/rpc/key_call.c b/lib/libc/rpc/key_call.c
index 615f24d..6cc1139 100644
--- a/lib/libc/rpc/key_call.c
+++ b/lib/libc/rpc/key_call.c
@@ -302,7 +302,7 @@ int vers;
void *localhandle;
struct netconfig *nconf;
struct netconfig *tpconf;
- struct key_call_private *kcp = key_call_private_main;
+ struct key_call_private *kcp;
struct timeval wait_time;
struct utsname u;
int main_thread;
diff --git a/lib/libc/stdio/fgetws.c b/lib/libc/stdio/fgetws.c
index bbc0299..550843d 100644
--- a/lib/libc/stdio/fgetws.c
+++ b/lib/libc/stdio/fgetws.c
@@ -89,7 +89,7 @@ fgetws(wchar_t * __restrict ws, int n, FILE * __restrict fp)
if (!__mbsinit(&fp->_mbstate))
/* Incomplete character */
goto error;
- *wsp++ = L'\0';
+ *wsp = L'\0';
FUNLOCKFILE(fp);
return (ws);
diff --git a/lib/libc/yp/yplib.c b/lib/libc/yp/yplib.c
index eb5c34c..87d16dd 100644
--- a/lib/libc/yp/yplib.c
+++ b/lib/libc/yp/yplib.c
@@ -241,7 +241,7 @@ static bool_t
ypmatch_cache_lookup(struct dom_binding *ypdb, char *map, keydat *key,
valdat *val)
{
- struct ypmatch_ent *c = ypdb->cache;
+ struct ypmatch_ent *c;
ypmatch_cache_expire(ypdb);
OpenPOWER on IntegriCloud