nist.c : Fix a bug where a variable was being used without being initialized.

This commit is contained in:
Erik de Castro Lopo 2005-07-23 06:12:38 +00:00
parent 1ae9d20e71
commit 567dab060c
2 changed files with 17 additions and 2 deletions

View File

@ -1,3 +1,8 @@
2005-07-23 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/nist.c
Fix a bug where a variable was being used without being initialized.
2005-07-21 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
* src/common.h

View File

@ -72,6 +72,7 @@ nist_open (SF_PRIVATE *psf)
psf->endian = (CPU_IS_BIG_ENDIAN) ? SF_ENDIAN_BIG : SF_ENDIAN_LITTLE ;
psf->blockwidth = psf->bytewidth * psf->sf.channels ;
psf->sf.frames = 0 ;
if ((error = nist_write_header (psf, SF_FALSE)))
return error ;
@ -274,8 +275,17 @@ nist_write_header (SF_PRIVATE *psf, int calc_length)
current = psf_ftell (psf) ;
/* Prevent compiler warning. */
calc_length = calc_length ;
if (calc_length)
{ psf->filelength = psf_get_filelen (psf) ;
psf->datalength = psf->filelength - psf->dataoffset ;
if (psf->dataend)
psf->datalength -= psf->filelength - psf->dataend ;
if (psf->bytewidth > 0)
psf->sf.frames = psf->datalength / (psf->bytewidth * psf->sf.channels) ;
} ;
if (psf->endian == SF_ENDIAN_BIG)
end_str = "10" ;