mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-08-31 06:16:03 +00:00
Fix compiler warnings about format specifiers with DEBUG set
As for %s when the pointer is null: even if gcc prints (null) this is still undefined behavior, so we should do this explicitly Signed-off-by: Ryan Lee <ryan.lee@canonical.com>
This commit is contained in:
@@ -245,7 +245,7 @@ static inline void sd_write_uint64(std::ostringstream &buf, u64 b)
|
||||
|
||||
static inline void sd_write_name(std::ostringstream &buf, const char *name)
|
||||
{
|
||||
PDEBUG("Writing name '%s'\n", name);
|
||||
PDEBUG("Writing name '%s'\n", name ? name : "(null)");
|
||||
if (name) {
|
||||
sd_write8(buf, SD_NAME);
|
||||
sd_write16(buf, strlen(name) + 1);
|
||||
|
Reference in New Issue
Block a user