diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-26 18:17:49 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2010-04-26 18:18:49 +0100 |
commit | 3a2d9ffe0333090bb31ff01048ed506595f20cf9 (patch) | |
tree | 390a72918081af778f16baac5cfd66866d9e8bed /util/cairo-trace | |
parent | 37be183412eb35abc11e602857602aee05839fc7 (diff) |
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
Diffstat (limited to 'util/cairo-trace')
-rw-r--r-- | util/cairo-trace/trace.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/util/cairo-trace/trace.c b/util/cairo-trace/trace.c index d577c5510..2dd6e2520 100644 --- a/util/cairo-trace/trace.c +++ b/util/cairo-trace/trace.c @@ -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) { |