mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2025-12-25 20:00:11 +01:00
trace: Check return value to suppress compiler warning
trace.c: In function ‘get_prog_name’: trace.c:741: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result
This commit is contained in:
parent
37be183412
commit
3a2d9ffe03
1 changed files with 4 additions and 1 deletions
|
|
@ -738,8 +738,11 @@ get_prog_name (char *buf, int length)
|
|||
|
||||
file = fopen ("/proc/self/cmdline", "rb");
|
||||
if (file != NULL) {
|
||||
fgets (buf, length, file);
|
||||
slash = fgets (buf, length, file);
|
||||
fclose (file);
|
||||
|
||||
if (slash == NULL)
|
||||
return;
|
||||
} else {
|
||||
char const *name = getenv ("CAIRO_TRACE_PROG_NAME");
|
||||
if (name != NULL) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue