]> diplodocus.org Git - nmh/commitdiff
Moved #include <assert.h> to h/nmh.h.
authorDavid Levine <levinedl@acm.org>
Sat, 30 Mar 2013 14:53:10 +0000 (09:53 -0500)
committerDavid Levine <levinedl@acm.org>
Sat, 30 Mar 2013 14:53:10 +0000 (09:53 -0500)
h/nmh.h
sbr/escape_addresses.c
sbr/m_getfld.c
uip/refile.c

diff --git a/h/nmh.h b/h/nmh.h
index b2bac8f0b09b689835af2b1ff6dc59070a26a549..00fd943a9814e2a40ad3dfbfbbf53bafeb8918b4 100644 (file)
--- a/h/nmh.h
+++ b/h/nmh.h
@@ -14,6 +14,7 @@
   /* See etc/gen-ctype-checked.c. */
 # include <sbr/ctype-checked.h>
 #endif
   /* See etc/gen-ctype-checked.c. */
 # include <sbr/ctype-checked.h>
 #endif
+#include <assert.h>
 #include <sys/stat.h>
 
 # include <dirent.h>
 #include <sys/stat.h>
 
 # include <dirent.h>
index a7dc14672852748d2456071f97fa7617e1a1fc2e..43bf1a2974f5484837ee6df5de71c1577802f85b 100644 (file)
@@ -6,10 +6,8 @@
  * complete copyright information.
  */
 
  * complete copyright information.
  */
 
-#include <sys/types.h>
+#include <h/nmh.h>
 #include <h/utils.h>
 #include <h/utils.h>
-#include <string.h>
-#include <stdlib.h>
 
 static void
 escape_component (char *name, size_t namesize, char *chars);
 
 static void
 escape_component (char *name, size_t namesize, char *chars);
@@ -77,8 +75,8 @@ escape_component (char *name, size_t namesize, char *chars_to_escape) {
         }
 
         if (strcmp (tmp, "\"")) {
         }
 
         if (strcmp (tmp, "\"")) {
-            /* assert (strlen(tmp) + 1 == destp - tmp); */
             size_t len = destp - tmp;
             size_t len = destp - tmp;
+            assert ((ssize_t) strlen(tmp) + 1 == destp - tmp);
             strncpy (name, tmp, len <= namesize  ?  len  :  namesize);
         } else {
             /* Handle just " as special case here instead of above. */
             strncpy (name, tmp, len <= namesize  ?  len  :  namesize);
         } else {
             /* Handle just " as special case here instead of above. */
index c6716284d7f65732dc4575461e4aa75d82f0ad90..45bcebabda08e16d2ded8eb582d821957bd2b527 100644 (file)
@@ -431,7 +431,7 @@ read_more (m_getfld_state_t s) {
     size_t num_read;
 
     if (retain < s->end - s->readpos) retain = s->end - s->readpos;
     size_t num_read;
 
     if (retain < s->end - s->readpos) retain = s->end - s->readpos;
-    /* assert (retain <= s->readpos - s->msg_buf <= sizeof msg_buf); */
+    assert (retain <= s->readpos - s->msg_buf);
 
     /* Move what we want to retain at end of the buffer to the beginning. */
     memmove (s->msg_buf, s->readpos - retain, retain);
 
     /* Move what we want to retain at end of the buffer to the beginning. */
     memmove (s->msg_buf, s->readpos - retain, retain);
index 8a4392b77b37e154b0ef9c534ce3dd116c1a4fac..205041e0501fab4edce906dab6eebd6aab506aa0 100644 (file)
@@ -12,7 +12,6 @@
 #include <h/utils.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <h/utils.h>
 #include <fcntl.h>
 #include <errno.h>
-#include <assert.h>
 
 #define REFILE_SWITCHES \
     X("draft", 0, DRAFTSW) \
 
 #define REFILE_SWITCHES \
     X("draft", 0, DRAFTSW) \