Make sure the copy length is at least one shorter than the buffer
size. This isn't strictly required as we would be forcefully NULL
terminating the string aynway, but this silences the compiler warning
we are getting with modern versions of gcc.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@iki.fi>
map->pid = pid;
map->tid = tid;
- strncpy(map->name, line + skip, sizeof(map->name));
+ strncpy(map->name, line + skip, sizeof(map->name) - 1);
/* zero out the newline */
map->name[MAX(strlen(map->name) - 1, 0)] = '\0';