diff --git a/tagutils/tagutils-aac.c b/tagutils/tagutils-aac.c index 77ea7dd..16b1301 100644 --- a/tagutils/tagutils-aac.c +++ b/tagutils/tagutils-aac.c @@ -236,7 +236,7 @@ _aac_check_extended_descriptor(FILE *infile) short int i; unsigned char buf[3]; - if( !fread((void *)&buf, 3, 1, infile) ) + if( fread((void *)&buf, 1, 3, infile) < 3 ) return -1; for( i=0; i<3; i++ ) { @@ -286,8 +286,8 @@ _get_aacfileinfo(char *file, struct song_metadata *psong) if(atom_offset != -1) { fseek(infile, 12, SEEK_CUR); - if(!fread((void*)&sample_size, 1, sizeof(int), infile) || - !fread((void*)&samples, 1, sizeof(int), infile)) + if(fread((void*)&sample_size, 1, sizeof(int), infile) != sizeof(int) || + fread((void*)&samples, 1, sizeof(int), infile) != sizeof(int)) { fclose(infile); return -1; diff --git a/tagutils/tagutils-asf.c b/tagutils/tagutils-asf.c index b64ebbd..687d64d 100644 --- a/tagutils/tagutils-asf.c +++ b/tagutils/tagutils-asf.c @@ -92,7 +92,7 @@ fget_byte(FILE *fp) { uint8_t d; - if (!fread(&d, sizeof(d), 1, fp)) + if (fread(&d, sizeof(d), 1, fp) != 1) return 0; return d; } @@ -102,7 +102,7 @@ fget_le16(FILE *fp) { uint16_t d; - if (!fread(&d, sizeof(d), 1, fp)) + if (fread(&d, sizeof(d), 1, fp) != 1) return 0; d = le16_to_cpu(d); return d; @@ -113,7 +113,7 @@ fget_le32(FILE *fp) { uint32_t d; - if (!fread(&d, sizeof(d), 1, fp)) + if (fread(&d, sizeof(d), 1, fp) != 1) return 0; d = le32_to_cpu(d); return d; diff --git a/tagutils/tagutils-wav.c b/tagutils/tagutils-wav.c index 80c5cdf..22bfb62 100644 --- a/tagutils/tagutils-wav.c +++ b/tagutils/tagutils-wav.c @@ -111,7 +111,7 @@ _get_wavtags(char *filename, struct song_metadata *psong) { //DEBUG DPRINTF(E_DEBUG,L_SCANNER,"Found 'fmt ' header\n"); len = 16; - if(!read(fd, fmt, len) || (len != 16)) + if(read(fd, fmt, len) != len) { close(fd); DPRINTF(E_WARN, L_SCANNER, "Bad .wav file: can't read fmt: %s\n", diff --git a/tivo_utils.c b/tivo_utils.c index 9142099..32bcc08 100644 --- a/tivo_utils.c +++ b/tivo_utils.c @@ -155,7 +155,7 @@ is_tivo_file(const char *path) fd = open(path, O_RDONLY); if( !fd ) return 0; - if( read(fd, buf, 5) < 0 ) + if( read(fd, buf, 5) < 5 ) buf[0] = 'X'; close(fd);