Skip to content

Commit

Permalink
Specify explicit format for fprintf()
Browse files Browse the repository at this point in the history
The second argument in fprintf() needs to be a format, not
the (random) string that is actually filled in. Otherwise, the
behaviour is unexpected/undefined when the string contains a percent
sign.
  • Loading branch information
olebole committed Dec 13, 2017
1 parent 9590f45 commit 3c3e4a3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sys/memdbg/memlog.c
Expand Up @@ -133,7 +133,7 @@ char *message;
"------", number++, "------");

/* Output message. */
fprintf (fp, message);
fprintf (fp, "%s", message);
fprintf (fp, "\n");

fflush (fp);
Expand Down

0 comments on commit 3c3e4a3

Please sign in to comment.