gio-launch-desktop: Fix a compiler warning

Signed-off-by: Simon McVittie <smcv@collabora.com>
This commit is contained in:
Simon McVittie 2022-07-14 14:59:54 +01:00 committed by Philip Withnall
parent 6620d28333
commit e4e21f20e2

View File

@ -44,7 +44,7 @@ main (int argc, char *argv[])
return -1;
r = snprintf (buf, sizeof (buf), "GIO_LAUNCHED_DESKTOP_FILE_PID=%ld", (long) pid);
if (r >= sizeof (buf))
if (r < 0 || (size_t) r >= sizeof (buf))
return -1;
putenv (buf);