From 07f8542ce7b14cbd044762aedb9020ca4fdd22e6 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Wed, 4 Jan 2006 23:51:03 +0000 Subject: [PATCH] use proper fwrite() parameters and return value git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2@7805 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- formats/format_pcm.c | 6 +++--- formats/format_pcm_alaw.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/formats/format_pcm.c b/formats/format_pcm.c index 7a1e98b7a7..87363239d6 100644 --- a/formats/format_pcm.c +++ b/formats/format_pcm.c @@ -201,11 +201,11 @@ static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence) size_t res; while (left) { - res = fwrite(ulaw_silence, (left > BUF_SIZE) ? BUF_SIZE : left, - sizeof(ulaw_silence[0]), fs->f); + res = fwrite(ulaw_silence, sizeof(ulaw_silence[0]), + (left > BUF_SIZE) ? BUF_SIZE : left, fs->f); if (res == -1) return res; - left -= res; + left -= res * sizeof(ulaw_silence[0]); } return offset; } diff --git a/formats/format_pcm_alaw.c b/formats/format_pcm_alaw.c index 811a6ef6a6..b26796bdab 100644 --- a/formats/format_pcm_alaw.c +++ b/formats/format_pcm_alaw.c @@ -276,11 +276,11 @@ static int pcm_seek(struct ast_filestream *fs, long sample_offset, int whence) size_t res; while (left) { - res = fwrite(alaw_silence, (left > BUF_SIZE) ? BUF_SIZE : left, - sizeof(alaw_silence[0]), fs->f); + res = fwrite(alaw_silence, sizeof(alaw_silence[0]), + (left > BUF_SIZE) ? BUF_SIZE : left, fs->f); if (res == -1) return res; - left -= res; + left -= res * sizeof(alaw_silence[0]); } return offset; }