diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-04-26 16:15:12 +1200 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-04-26 16:15:12 +1200 |
commit | ce39e8e6fa1d8220e4050219ad72dfdc77ee1cfc (patch) | |
tree | 1a5ebbe51a05000b9a80f7d63278ee1efb916a9f /misc.c | |
parent | 01a3d56ab3c71a065c3b827740dade5f27e95ef3 (diff) | |
download | cue-bin-split-ce39e8e6fa1d8220e4050219ad72dfdc77ee1cfc.tar.xz |
Fix snprintf overflow detection, add newline to error message
Diffstat (limited to 'misc.c')
-rw-r--r-- | misc.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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; |