aboutsummaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorDavid Phillips <dbphillipsnz@gmail.com>2016-04-26 16:15:12 +1200
committerDavid Phillips <dbphillipsnz@gmail.com>2016-04-26 16:15:12 +1200
commitce39e8e6fa1d8220e4050219ad72dfdc77ee1cfc (patch)
tree1a5ebbe51a05000b9a80f7d63278ee1efb916a9f /misc.c
parent01a3d56ab3c71a065c3b827740dade5f27e95ef3 (diff)
downloadcue-bin-split-ce39e8e6fa1d8220e4050219ad72dfdc77ee1cfc.tar.xz
Fix snprintf overflow detection, add newline to error message
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/misc.c b/misc.c
index 7ee275a..1515a7d 100644
--- a/misc.c
+++ b/misc.c
@@ -56,7 +56,7 @@ double get_sec()
*/
int construct_out_name(char *buffer, size_t buffer_size, char* format, unsigned int track)
{
- if (snprintf(buffer, buffer_size, format, track) == buffer_size)
+ if (snprintf(buffer, buffer_size, format, track) >= buffer_size - 1)
{
fprintf(stderr, "Filename too large for buffer (max %zd)\n", buffer_size);
return -1;