fix unsigned integer comparison in read() == size statements.
authorGustavo Sverzut Barbieri <gustavo.barbieri@intel.com>
Wed, 19 Nov 2014 18:56:04 +0000 (16:56 -0200)
committerGustavo Sverzut Barbieri <gustavo.barbieri@intel.com>
Wed, 19 Nov 2014 18:56:04 +0000 (16:56 -0200)
src/plugins/id3/id3.c
src/plugins/jpeg/jpeg.c

index 80f88a0..9de2218 100644 (file)
@@ -1033,7 +1033,7 @@ _parse_id3v2(int fd, long id3v2_offset, struct id3_info *info,
                 lseek(fd, 4, SEEK_CUR);
 
             frame_data = malloc(sizeof(char) * fh.frame_size);
-            if (read(fd, frame_data, fh.frame_size) != fh.frame_size) {
+            if (read(fd, frame_data, fh.frame_size) != (int)fh.frame_size) {
                 free(frame_data);
                 return -1;
             }
index 70c1750..2597e28 100644 (file)
@@ -297,7 +297,7 @@ _exif_text_encoding_get(int fd, unsigned int count, int offset, struct lms_strin
 
     s->str = malloc(count + 1);
 
-    if (read(fd, s->str, count) != count) {
+    if (read(fd, s->str, count) != (int)count) {
         perror("read");
         free(s->str);
         s->str = NULL;
@@ -328,7 +328,7 @@ _exif_text_ascii_get(int fd, unsigned int count, int offset, struct lms_string_s
 
     s->str = malloc(count);
 
-    if (read(fd, s->str, count) != count) {
+    if (read(fd, s->str, count) != (int)count) {
         perror("read");
         free(s->str);
         s->str = NULL;