Skip to content

Commit

Permalink
trace: Check return value to suppress compiler warning
Browse files Browse the repository at this point in the history
trace.c: In function ‘get_prog_name’:
trace.c:741: warning: ignoring return value of ‘fgets’, declared with
attribute warn_unused_result
  • Loading branch information
Chris Wilson committed Apr 26, 2010
1 parent 37be183 commit 3a2d9ff
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion util/cairo-trace/trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 3a2d9ff

Please sign in to comment.