X-Git-Url: https://plomlompom.com/repos/test.html?a=blobdiff_plain;f=src%2Fcommon%2Ftry_malloc.c;h=053d4306e460b5f319a9ff5eee7804027b15a8b9;hb=49e98f8588221beed82e8fda1cdeb90ad28663c7;hp=81e75bf6bda6aa3f0ed5a86205f1b1dc93be6a9d;hpb=1cb57a35a3b3cc4ec8870531ca254a655c0bdda2;p=plomrogue
diff --git a/src/common/try_malloc.c b/src/common/try_malloc.c
index 81e75bf..053d430 100644
--- a/src/common/try_malloc.c
+++ b/src/common/try_malloc.c
@@ -1,4 +1,9 @@
-/* src/common/try_malloc.c */
+/* src/common/try_malloc.c
+ *
+ * This file is part of PlomRogue. PlomRogue is licensed under the GPL version 3
+ * or any later version. For details on its copyright, license, and warranties,
+ * see the file NOTICE in the root directory of the PlomRogue source package.
+ */
#include "try_malloc.h"
#include /* for malloc */
@@ -13,12 +18,12 @@ extern void * try_malloc(size_t size, const char * f)
{
char * prefix = "Trouble with malloc in ";
char * msg = malloc(strlen(prefix) + strlen(f) + 1 + 1);
- exit_err(NULL == msg,
+ exit_err(!msg,
"Trouble in try_malloc with malloc for error message string.");
int test = sprintf(msg, "%s%s.", prefix, f);
exit_err(test < 0, "Trouble in try_malloc with sprintf.");
void * p = malloc(size);
- exit_err(NULL == p, msg); /* Bypass exit_trouble() calling try_malloc(). */
+ exit_err(!p, msg); /* Bypass exit_trouble() calling try_malloc(). */
free(msg);
return p;
}