]> git.ipfire.org Git - thirdparty/mlmmj.git/commitdiff
parse_latestdigest: use chomp
authorBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 22 Dec 2023 10:51:43 +0000 (11:51 +0100)
committerBaptiste Daroussin <bapt@FreeBSD.org>
Fri, 22 Dec 2023 10:51:43 +0000 (11:51 +0100)
src/mlmmj.c

index 6c6c41a0b4cae1619dcfc5aa4764e21a17eaad09..6c63b913ea2b4479b5660004593691e80cd81661 100644 (file)
@@ -85,9 +85,7 @@ parse_lastdigest(char *line, long *lastindex, time_t *lasttime,
                return true;
        }
        walk = walk + strlen(walk) + 1;
-       size_t l = strlen(walk) -1;
-       if (walk[l] == '\n')
-               walk[l] = '\0';
+       chomp(walk);
        *lastissue = strtoim(walk, LONG_MIN, LONG_MAX, errstr);
        if (*errstr != NULL) {
                *errstr = "Invalid value for lastissue";