shithub: dumb

Download patch

ref: f6ee2e9b36e14613cbd7b8ee678251c4cbdfdc9f
parent: b5f4876aa11c060c9b9bb3d8bbd2d168c5be00e9
author: Christopher Snowhill <kode54@gmail.com>
date: Mon Jan 29 14:36:28 EST 2018

Fix pattern n_entries calculation, which was broken when attempting to fix the warning incorrectly with long casts, which resulted in n_entries that were horribly inflated, possibly breaking code that didn't expect the change.

--- a/src/it/readam.c
+++ b/src/it/readam.c
@@ -255,7 +255,7 @@
         ++row;
     }
 
-    pattern->n_entries = (int)((long)entry - (long)pattern->entry);
+    pattern->n_entries = (int)(entry - pattern->entry);
     if (!pattern->n_entries)
         return -1;
 
--- a/src/it/readdsmf.c
+++ b/src/it/readdsmf.c
@@ -202,7 +202,7 @@
         ++row;
     }
 
-    pattern->n_entries = (int)((long)entry - (long)pattern->entry);
+    pattern->n_entries = (int)(entry - pattern->entry);
     if (!pattern->n_entries)
         return -1;
 
--- a/src/it/readpsm.c
+++ b/src/it/readpsm.c
@@ -485,7 +485,7 @@
         row++;
     }
 
-    pattern->n_entries = (int)((long)entry - (long)pattern->entry);
+    pattern->n_entries = (int)(entry - pattern->entry);
     if (!pattern->n_entries)
         return -1;