From 042e3df65d469c03cf1b2d068102619cff3e1d30 Mon Sep 17 00:00:00 2001 From: Alexander Babikov Date: Thu, 14 Apr 2022 06:56:03 +0500 Subject: [PATCH] Suppress a false positive -Wformat-truncation warning in Discord integration code --- src/discord.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/discord.c b/src/discord.c index 7a9dc1fec..12a5a0396 100644 --- a/src/discord.c +++ b/src/discord.c @@ -88,6 +88,8 @@ discord_update_activity(int paused) if (paren) *(paren - 1) = '\0'; +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wformat-truncation" if (strlen(vm_name) < 100) { snprintf(activity.details, sizeof(activity.details), "Running \"%s\"", vm_name); @@ -98,6 +100,7 @@ discord_update_activity(int paused) strncpy(activity.details, strchr(machine_getname(), ']') + 2, sizeof(activity.details) - 1); snprintf(activity.state, sizeof(activity.state), "%s/%s", cpufamily, cpu_s->name); } +#pragma GCC diagnostic pop activity.timestamps.start = time(NULL);