]> diplodocus.org Git - nmh/blobdiff - sbr/utils.c
Don't need to cast to `char *' for free(3) these days.
[nmh] / sbr / utils.c
index fff1aacd64debbaf62c4165c17fe2dc0214f436b..f5f2057032e3d1cf0afa2991ecf736e8a226a11b 100644 (file)
@@ -46,9 +46,7 @@ void *mh_xrealloc(void *ptr, size_t size)
 
     /* Copy POSIX behaviour, coping with non-POSIX systems. */
     if (size == 0) {
-        if (ptr) {
-            free(ptr);
-        }
+        mh_xfree(ptr);
         return mh_xmalloc(1); /* Get a unique pointer. */
     }
     if (!ptr)
@@ -481,15 +479,14 @@ nmh_version_changed (int older) {
         }
 
         return old_version < current_version  ?  1  :  0;
-    } else {
-        if (context_version == NULL  ||  strcmp(context_version, "nmh-" VERSION) != 0) {
-            context_replace ("Version", "nmh-" VERSION);
+    }
 
-            return 1;
-        } else {
-            return 0;
-        }
+    if (context_version == NULL  ||  strcmp(context_version, "nmh-" VERSION) != 0) {
+        context_replace ("Version", "nmh-" VERSION);
+        return 1;
     }
+
+    return 0;
 }