diff options
author | Erik de Castro Lopo <erikd@mega-nerd.com> | 2019-09-15 12:03:56 +1000 |
---|---|---|
committer | Erik de Castro Lopo <erikd@mega-nerd.com> | 2019-09-15 16:14:36 +1000 |
commit | 04974d271531d429384a6f124919ff64fbbefd81 (patch) | |
tree | 330baab536c2b9e8c79a7c69cbeccc6f7ec43b42 /src/flac/main.c | |
parent | 2409f5f39ddb9a4f89603eb4ff8480fa7f0726b2 (diff) | |
download | flac-04974d271531d429384a6f124919ff64fbbefd81.tar.gz |
Fix a number of gcc 9.2 compiler warnings
Diffstat (limited to 'src/flac/main.c')
-rw-r--r-- | src/flac/main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/flac/main.c b/src/flac/main.c index be072a3d..780ccc50 100644 --- a/src/flac/main.c +++ b/src/flac/main.c @@ -1928,13 +1928,12 @@ int encode_file(const char *infilename, FLAC__bool is_first_file, FLAC__bool is_ static const char *tmp_suffix = ".tmp,fl-ac+en'c"; size_t dest_len = strlen(outfilename) + strlen(tmp_suffix) + 1; /*@@@@ still a remote possibility that a file with this filename exists */ - if(0 == (internal_outfilename = safe_malloc_(dest_len))) { + if((internal_outfilename = safe_malloc_(dest_len)) == NULL) { flac__utils_printf(stderr, 1, "ERROR allocating memory for tempfile name\n"); conditional_fclose(encode_infile); return 1; } - safe_strncpy(internal_outfilename, outfilename, dest_len); - safe_strncat(internal_outfilename, tmp_suffix, dest_len); + snprintf(internal_outfilename, dest_len, "%s%s", outfilename, tmp_suffix); } if(input_format == FORMAT_RAW) { |