Rewrites: fix delivery crash from constant errors_to. Bug 3081
[exim.git] / src / src / header.c
index e2b3d8a9c2c9f92d0c5f69efe1682adc5704313d..97fa44b4ef41cd9473bf31ab63f572e006346cd3 100644 (file)
@@ -30,11 +30,12 @@ Returns:    TRUE or FALSE
 */
 
 BOOL
-header_testname(header_line *h, const uschar *name, int len, BOOL notdel)
+header_testname(const header_line * h, const uschar * name, int len,
+  BOOL notdel)
 {
 uschar *tt;
 if (h->type == '*' && notdel) return FALSE;
-if (h->text == NULL || strncmpic(h->text, name, len) != 0) return FALSE;
+if (!h->text || strncmpic(h->text, name, len) != 0) return FALSE;
 tt = h->text + len;
 while (*tt == ' ' || *tt == '\t') tt++;
 return *tt == ':';
@@ -46,11 +47,11 @@ return *tt == ':';
    header_testname() above. */
 
 BOOL
-header_testname_incomplete(header_line *h, const uschar *name,
+header_testname_incomplete(const header_line * h, const uschar * name,
     int len, BOOL notdel)
 {
 if (h->type == '*' && notdel) return FALSE;
-if (h->text == NULL || strncmpic(h->text, name, len) != 0) return FALSE;
+if (!h->text || strncmpic(h->text, name, len) != 0) return FALSE;
 return TRUE;
 }
 
@@ -109,7 +110,7 @@ gs.ptr = 0;
 
 if (!string_vformat(&gs, SVFMT_REBUFFER, format, ap))
   log_write(0, LOG_MAIN|LOG_PANIC_DIE, "string too long in header_add: "
-    "%.100s ...", string_from_gstring(&gs));
+    "%.100Y ...", &gs);
 
 if (gs.s != buf) store_release_above(buf);
 gstring_release_unused(&gs);
@@ -521,7 +522,7 @@ if (s && *s)
        }
       else
         llen = 0;
-      LDONE:
+      LDONE: ;
       }
     else                               /* rest of s fits in line */
       {