Correct signed/unsigned comparisons or make them explicit
diff --git a/dump_cis.c b/dump_cis.c
index ec0ecb1..4da3f0d 100644
--- a/dump_cis.c
+++ b/dump_cis.c
@@ -116,7 +116,7 @@
 
 static void print_unit(u_int v, char *unit, char tag)
 {
-    int n;
+    u_int n;
     for (n = 0; (v % 1000) == 0; n++) v /= 1000;
     printf("%u", v);
     if (n < strlen(unit)) putchar(unit[n]);
@@ -930,7 +930,8 @@
 	arg->tuple.TupleLink = arg->tuple.CISOffset = 0;
     }
     ofs = arg->tuple.CISOffset + arg->tuple.TupleLink;
-    if (ofs >= nb) return -1;
+    if (nb < 0 || ofs >= (u_int)nb)
+	return -1;
     arg->tuple.TupleCode = buf[ofs++];
     arg->tuple.TupleDataLen = arg->tuple.TupleLink = buf[ofs++];
     arg->tuple.CISOffset = ofs;
diff --git a/pack_cis.c b/pack_cis.c
index 67ebbba..043a0f8 100644
--- a/pack_cis.c
+++ b/pack_cis.c
@@ -52,7 +52,7 @@
 #include "pack_cis.h"
 
 tuple_info_t *cis_root = NULL, *mfc[8] = { NULL };
-int nf = 0;
+u_int nf = 0;
 
 /*======================================================================
 
diff --git a/pack_cis.h b/pack_cis.h
index c212444..5f2378f 100644
--- a/pack_cis.h
+++ b/pack_cis.h
@@ -33,6 +33,6 @@
 } tuple_info_t;
 
 extern tuple_info_t *cis_root, *mfc[8];
-extern int nf;
+extern u_int nf;
 
 void parse_cis(FILE *f);