suppress a cppcheck false positive
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 Aug 2016 17:11:49 +0000 (11:11 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 12 Aug 2016 17:11:49 +0000 (11:11 -0600)
src/utmp.c

index 7929a04fa91d154ad6aab67fc1cff8edd4148531..ea87ba71bd4a193f01f22e28aa3ede8319ff213f 100644 (file)
@@ -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);