commit b7ced457451732add8f4107e469ced58fc8d4d4a from: Florian Obser date: Thu Jul 21 05:40:50 2022 UTC We don't care about the length of the read line. Found by llvm's scan-build (dead store). OK stsp commit - eff568509962015d1495b29d30e8375b7ee427e4 commit + b7ced457451732add8f4107e469ced58fc8d4d4a blob - c32dc030ca5a55f45b8426657e65e9c079640391 blob + c55c84a54474d7a32640abed764ed50b3fc9ad5a --- got/got.c +++ got/got.c @@ -396,7 +396,6 @@ edit_logmsg(char **logmsg, const char *editor, const c const struct got_error *err = NULL; char *line = NULL; size_t linesize = 0; - ssize_t linelen; struct stat st, st2; FILE *fp = NULL; size_t len, logmsg_len; @@ -463,7 +462,7 @@ edit_logmsg(char **logmsg, const char *editor, const c } len = 0; - while ((linelen = getline(&line, &linesize, fp)) != -1) { + while (getline(&line, &linesize, fp) != -1) { if ((line[0] == '#' || (len == 0 && line[0] == '\n'))) continue; /* remove comments and leading empty lines */ len = strlcat(*logmsg, line, logmsg_len + 1); @@ -3933,7 +3932,6 @@ match_patch(int *have_match, struct got_commit_object const struct got_error *err = NULL; char *line = NULL; size_t linesize = 0; - ssize_t linelen; regmatch_t regmatch; *have_match = 0; @@ -3951,7 +3949,7 @@ match_patch(int *have_match, struct got_commit_object goto done; } - while ((linelen = getline(&line, &linesize, f)) != -1) { + while (getline(&line, &linesize, f) != -1) { if (regexec(regex, line, 1, ®match, 0) == 0) { *have_match = 1; break;