Test
[VerusCoin.git] / src / komodo_gateway.h
index 4e2bbcabf0496bf9343fa45e3c33be20e8811790..4f5abb2fc6bae2bcae76b7a0ae86d91bf3c0906c 100644 (file)
@@ -1377,10 +1377,10 @@ void *OS_loadfile(char *fname,uint8_t **bufp,long *lenp,long *allocsizep)
             printf("OS_loadfile null size.(%s)\n",fname);
             return(0);
         }
-        if ( filesize > buflen-1 )
+        if ( filesize > buflen )
         {
             *allocsizep = filesize;
-            *bufp = buf = (uint8_t *)realloc(buf,(long)*allocsizep);
+            *bufp = buf = (uint8_t *)realloc(buf,(long)*allocsizep+64);
         }
         rewind(fp);
         if ( buf == 0 )
@@ -1418,7 +1418,7 @@ long komodo_stateind_validate(struct komodo_state *sp,char *indfname,uint8_t *fi
         {
             n = (int32_t)(fsize / sizeof(uint32_t));
             for (i=0; i<n; i++)
-            {break;
+            {
                 memcpy(&tmp,&inds[i * sizeof(uint32_t)],sizeof(uint32_t));
                 if ( 0 && i > n-10 )
                     printf("%d: tmp.%08x [%c] prevpos100.%u\n",i,tmp,tmp&0xff,prevpos100);
This page took 0.024101 seconds and 4 git commands to generate.