Check all snprintf calls for returning values.

This commit is contained in:
Milan Broz
2022-02-24 15:03:21 +01:00
parent c27d6a89bb
commit 677e06c48a
12 changed files with 79 additions and 40 deletions

View File

@@ -48,9 +48,10 @@ static int dm_prepare_uuid(const char *type, const char *uuid, char *buf, size_t
}
}
snprintf(buf, buflen, DM_UUID_PREFIX "%s%s%s%s",
type ?: "", type ? "-" : "",
uuid2[0] ? uuid2 : "", uuid2[0] ? "-" : "");
if (snprintf(buf, buflen, DM_UUID_PREFIX "%s%s%s%s",
type ?: "", type ? "-" : "",
uuid2[0] ? uuid2 : "", uuid2[0] ? "-" : "") < 0)
return 0;
return 1;
}