libuuid: (test) make sure UUID is terminated [coverity scan]

Signed-off-by: Karel Zak <kzak@redhat.com>
pull/1104/head
Karel Zak 2 years ago
parent 59ba65df21
commit fc701415c4
  1. 3
      libuuid/src/test_uuid.c

@ -76,8 +76,7 @@ static int check_uuids_in_file(const char *file)
return 1;
}
while ((sz = read(fd, str, sizeof(str))) != 0) {
if (isspace(str[sizeof(str) - 1]))
str[sizeof(str) - 1] = '\0';
str[sizeof(str) - 1] = '\0';
if (uuid_parse(str, uuidBits)) {
warnx("%s: %s", file, str);
ret++;

Loading…
Cancel
Save