]> diplodocus.org Git - nmh/blobdiff - uip/mhical.c
sizeof char is always 1, so don't bother to divide by it.
[nmh] / uip / mhical.c
index 27f7c9f1bbefb8fc4c235d719eeefe57fcae8e7f..67ba90da57f3b67dec3ce8da1c14e08496baa6a8 100644 (file)
@@ -1,5 +1,4 @@
-/*
- * mhical.c -- operate on an iCalendar request
+/* mhical.c -- operate on an iCalendar request
  *
  * This code is Copyright (c) 2014, by the authors of nmh.
  * See the COPYRIGHT file in the root directory of the nmh
@@ -399,13 +398,14 @@ convert_common (contentline *clines, act action) {
 
     if ((node = find_contentline (clines, "VERSION", 0))) {
         if (! node->value) {
-            admonish (NULL, "Version property is missing value, assume 2.0");
+            inform("Version property is missing value, assume 2.0, continuing...");
             node->value = mh_xstrdup ("2.0");
         }
 
         if (strcmp (node->value, "2.0")) {
-            admonish (NULL, "supports the Version 2.0 specified by RFC 5545 "
-                            "but iCalendar object has Version %s", node->value);
+            inform("supports the Version 2.0 specified by RFC 5545 "
+               "but iCalendar object has Version %s, continuing...",
+               node->value);
             node->value = mh_xstrdup ("2.0");
         }
     }
@@ -460,10 +460,10 @@ convert_common (contentline *clines, act action) {
                 free (node->value);
                 node->value = mh_xstrdup (buf);
             } else {
-                admonish (NULL, "strftime unable to format current time");
+                inform("strftime unable to format current time, continuing...");
             }
         } else {
-            admonish (NULL, "gmtime_r failed on current time");
+            inform("gmtime_r failed on current time, continuing...");
         }
     }
 
@@ -809,7 +809,7 @@ fold (char *line, int uses_cr) {
 #endif
 
         charstring_push_back_chars (folded_line, cp, char_len, 1);
-        remaining -= char_len > 0 ? char_len : 1;
+        remaining -= max(char_len, 1);
 
         /* remaining must be > 0 to pass the loop condition above, so
            if it's not > 1, it is == 1. */
@@ -824,7 +824,7 @@ fold (char *line, int uses_cr) {
             }
         }
 
-        cp += char_len > 0 ? char_len : 1;
+        cp += max(char_len, 1);
     }
 
     free (line);