aboutsummaryrefslogtreecommitdiffstats
path: root/formats/format_wav.c
diff options
context:
space:
mode:
Diffstat (limited to 'formats/format_wav.c')
-rw-r--r--formats/format_wav.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/formats/format_wav.c b/formats/format_wav.c
index 2a40dedbd..856c28c1d 100644
--- a/formats/format_wav.c
+++ b/formats/format_wav.c
@@ -329,8 +329,11 @@ static void wav_close(struct ast_filestream *s)
char zero = 0;
struct wav_desc *fs = (struct wav_desc *)s->_private;
/* Pad to even length */
- if (fs->bytes & 0x1)
- fwrite(&zero, 1, 1, s->f);
+ if (fs->bytes & 0x1) {
+ if (!fwrite(&zero, 1, 1, s->f)) {
+ ast_log(LOG_WARNING, "fwrite() failed: %s\n", strerror(errno));
+ }
+ }
}
static struct ast_frame *wav_read(struct ast_filestream *s, int *whennext)