From 25f39ff31d2e3e86fe66df520142dd48c40e64f8 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Fri, 12 Aug 2016 11:11:49 -0600 Subject: [PATCH] suppress a cppcheck false positive --- src/utmp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/utmp.c b/src/utmp.c index 7929a04fa..ea87ba71b 100644 --- a/src/utmp.c +++ b/src/utmp.c @@ -86,6 +86,7 @@ utmp_setid(sudo_utmp_t *old, sudo_utmp_t *new) /* Skip over "tty" in the id if old entry did too. */ if (old != NULL) { + /* cppcheck-suppress uninitdata */ if (strncmp(line, "tty", 3) == 0) { idlen = MIN(sizeof(old->ut_id), 3); if (strncmp(old->ut_id, "tty", idlen) != 0) @@ -94,6 +95,7 @@ utmp_setid(sudo_utmp_t *old, sudo_utmp_t *new) } /* Store as much as will fit, skipping parts of the beginning as needed. */ + /* cppcheck-suppress uninitdata */ idlen = strlen(line); if (idlen > sizeof(new->ut_id)) { line += idlen - sizeof(new->ut_id);