diff options
| -rw-r--r-- | sbc/sbcdec.c | 8 | 
1 files changed, 5 insertions, 3 deletions
| diff --git a/sbc/sbcdec.c b/sbc/sbcdec.c index decd758d..b5305550 100644 --- a/sbc/sbcdec.c +++ b/sbc/sbcdec.c @@ -46,7 +46,7 @@ static void decode(char *filename, char *audiodevice, int tofile)  	struct stat st;  	off_t filesize;  	sbc_t sbc; -	int fd, ad, pos, streamlen, framelen, count, format = AFMT_S16_BE, written; +	int fd, ad, pos, streamlen, framelen, count, written, format = AFMT_S16_BE;  	if (stat(filename, &st) < 0) {  		fprintf(stderr, "Can't get size of file %s: %s\n", @@ -122,7 +122,8 @@ static void decode(char *filename, char *audiodevice, int tofile)  			// buffer is too full to stuff decoded audio in  			// so it must be written to the device  			written = write(ad, buf, count); -			if (written > 0) count -= written; +			if (written > 0) +				count -= written;  		}  		// sanity check @@ -143,7 +144,8 @@ static void decode(char *filename, char *audiodevice, int tofile)  	if (count > 0) {  		written = write(ad, buf, count); -		if (written > 0) count -= written; +		if (written > 0) +			count -= written;  	}  close: | 
