Quiet warning caused by const argument to basename.

The cases in which this warning is legitimate are failing cases
for us anyway, so just cast away const to silence this warning.
pull/116/head
Doug Felt 2017-04-27 15:02:41 -07:00
parent 7a38f23a17
commit 46418225ff
1 changed files with 6 additions and 1 deletions

View File

@ -409,7 +409,12 @@ wave_flag (const char *filename, const char *out_prefix)
*out = '\0';
strcat (out, out_prefix);
// diff from upstream. we call this a bit differently, filename might not be in cwd.
strcat (out, basename(filename));
// basename wants a non-const argument. The problem here is paths that end in a
// slash, POSIX basename removes them while GNU just returns a pointer to that
// slash. Since this is supposed to be a filename such input is illegal for us.
// We're already not checking for overflow of the output buffer anyway...
strcat (out, basename((char *) filename));
cairo_surface_write_to_png (cairo_get_target (cr), out);
cairo_destroy (cr);