[PATCH 17/34] utmpdump: assigned values are never read [clang-analyzer]

Sami Kerola
2013-07-07T19:55:48Z

login-utils/utmpdump.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/login-utils/utmpdump.c b/login-utils/utmpdump.c
index 3febeaf..8b6f17d 100644
--- a/login-utils/utmpdump.c
+++ b/login-utils/utmpdump.c
@@ -252,7 +252,7 @@ static void undump(FILE *in, FILE *out)
char s_addr[16], s_time[29], *linestart, *line;
int count = 0;

- line = linestart = xmalloc(1024 * sizeof(*linestart));
+ linestart = xmalloc(1024 * sizeof(*linestart));
s_addr[15] = 0;
s_time[28] = 0;

@@ -266,7 +266,7 @@ static void undump(FILE *in, FILE *out)
line += gettok(line, ut.ut_line, sizeof(ut.ut_line), 1);
line += gettok(line, ut.ut_host, sizeof(ut.ut_host), 1);
line += gettok(line, s_addr, sizeof(s_addr) - 1, 1);
- line += gettok(line, s_time, sizeof(s_time) - 1, 0);
+ gettok(line, s_time, sizeof(s_time) - 1, 0);

ut.ut_addr = inet_addr(s_addr);
ut.ut_time = strtotime(s_time);
--
1.8.3.2