]> wagner.pp.ru Git - oss/catdoc.git/commitdiff
Fix couple of errors from coverity scan
authorVictor Wagner <vitus@wagner.pp.ru>
Thu, 28 Apr 2016 04:29:42 +0000 (07:29 +0300)
committerVictor Wagner <vitus@wagner.pp.ru>
Thu, 28 Apr 2016 04:29:42 +0000 (07:29 +0300)
src/ole.c
src/substmap.c

index e131a0dac2140921121edfeda7c65dc14fa3ffca..819ad33eded3a86271b6507c34d7855cd7e69a55 100644 (file)
--- a/src/ole.c
+++ b/src/ole.c
@@ -499,8 +499,8 @@ size_t ole_read(void *ptr, size_t size, size_t nmemb, FILE *stream) {
                int readbytes;
                blockNumber++;
                newoffset = calcFileBlockOffset(e,blockNumber);
-               if (newoffset != e->file_offset);
-               fseek(e->file, e->file_offset=newoffset , SEEK_SET);
+               if (newoffset != e->file_offset)
+                       fseek(e->file, e->file_offset=newoffset , SEEK_SET);
                readbytes=fread(cptr+rread, 1, min(llen-rread, ssize), e->file);
                rread +=readbytes;
                e->file_offset +=readbytes;
index ac9b9341f50a0ee1d934bdd2f00ddd1837ab9ae8..6e289243b524c6b1fca3fdb51f86abd0e65c6ac9 100644 (file)
@@ -78,7 +78,7 @@ SUBSTMAP read_substmap(char* filename) {
                }
                /* skip space between  code and sequence */
                for(;*p && isspace(*p);p++);
-               if (!p) continue;
+               if (!*p) continue;
                switch (*p) {
                        case '\'':
                        case '"':