From: Matthew Nicholson Date: Wed, 9 Nov 2011 15:25:33 +0000 (+0000) Subject: don't call ltohl() twice on the same value X-Git-Tag: 1.8.9.0-rc1~95 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8fafc727332b614282b269cad27f6dbf6507f9d8;p=thirdparty%2Fasterisk.git don't call ltohl() twice on the same value ASTERISK-18739 Patch by: pawel (modified) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@344048 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/formats/format_wav.c b/formats/format_wav.c index e2737e5c1b..2c1c3eca1a 100644 --- a/formats/format_wav.c +++ b/formats/format_wav.c @@ -81,7 +81,7 @@ static int check_header_fmt(FILE *f, int hsize, int hz) int bysec; int freq; if (hsize < 16) { - ast_log(LOG_WARNING, "Unexpected header size %d\n", ltohl(hsize)); + ast_log(LOG_WARNING, "Unexpected header size %d\n", hsize); return -1; } if (fread(&format, 1, 2, f) != 2) { @@ -129,8 +129,8 @@ static int check_header_fmt(FILE *f, int hsize, int hz) return -1; } /* Skip any additional header */ - if (fseek(f,ltohl(hsize)-16,SEEK_CUR) == -1 ) { - ast_log(LOG_WARNING, "Failed to skip remaining header bytes: %d\n", ltohl(hsize)-16 ); + if (fseek(f,hsize-16,SEEK_CUR) == -1 ) { + ast_log(LOG_WARNING, "Failed to skip remaining header bytes: %d\n", hsize-16 ); return -1; } return 0;