]> eyrie.org Git - kerberos/krb5-strength.git/commitdiff
Update util/xmalloc.c from rra-c-util
authorRuss Allbery <eagle@eyrie.org>
Sun, 31 Dec 2023 00:53:09 +0000 (16:53 -0800)
committerRuss Allbery <eagle@eyrie.org>
Sun, 31 Dec 2023 00:53:09 +0000 (16:53 -0800)
Fixes some additional formatting issues uncovered after krb5-strength
was released.

util/xmalloc.c

index 8495e60140f95d8d9c52651fc7e5639ad8bfef1b..2e3e1246a21f975d9fa066cc45ba8fa4b35cd71c 100644 (file)
@@ -121,7 +121,7 @@ x_malloc(size_t size, const char *file, int line)
     real_size = (size > 0) ? size : 1;
     p = malloc(real_size);
     while (p == NULL) {
-        (*xmalloc_error_handler)("malloc", size, file, line);
+        xmalloc_error_handler("malloc", size, file, line);
         p = malloc(real_size);
     }
     return p;
@@ -137,7 +137,7 @@ x_calloc(size_t n, size_t size, const char *file, int line)
     size = (size > 0) ? size : 1;
     p = calloc(n, size);
     while (p == NULL) {
-        (*xmalloc_error_handler)("calloc", n *size, file, line);
+        xmalloc_error_handler("calloc", n * size, file, line);
         p = calloc(n, size);
     }
     return p;
@@ -164,7 +164,7 @@ x_realloc(void *p, size_t size, const char *file, int line)
 #    pragma GCC diagnostic ignored "-Wuse-after-free"
 #endif
     while (newp == NULL) {
-        (*xmalloc_error_handler)("realloc", size, file, line);
+        xmalloc_error_handler("realloc", size, file, line);
         newp = realloc(p, size);
     }
     return newp;
@@ -195,7 +195,7 @@ x_reallocarray(void *p, size_t n, size_t size, const char *file, int line)
 #    pragma GCC diagnostic ignored "-Wuse-after-free"
 #endif
     while (newp == NULL) {
-        (*xmalloc_error_handler)("reallocarray", n *size, file, line);
+        xmalloc_error_handler("reallocarray", n * size, file, line);
         newp = reallocarray(p, n, size);
     }
 #if __GNUC__ >= 12 && !defined(__clang__)
@@ -214,7 +214,7 @@ x_strdup(const char *s, const char *file, int line)
     len = strlen(s) + 1;
     p = malloc(len);
     while (p == NULL) {
-        (*xmalloc_error_handler)("strdup", len, file, line);
+        xmalloc_error_handler("strdup", len, file, line);
         p = malloc(len);
     }
     memcpy(p, s, len);
@@ -240,7 +240,7 @@ x_strndup(const char *s, size_t size, const char *file, int line)
     length = p - s;
     copy = malloc(length + 1);
     while (copy == NULL) {
-        (*xmalloc_error_handler)("strndup", length + 1, file, line);
+        xmalloc_error_handler("strndup", length + 1, file, line);
         copy = malloc(length + 1);
     }
     memcpy(copy, s, length);
@@ -264,7 +264,7 @@ x_vasprintf(char **strp, const char *fmt, va_list args, const char *file,
         status = vsnprintf(NULL, 0, fmt, args_copy);
         va_end(args_copy);
         status = (status < 0) ? 0 : status + 1;
-        (*xmalloc_error_handler)("vasprintf", status, file, line);
+        xmalloc_error_handler("vasprintf", status, file, line);
         va_copy(args_copy, args);
         status = vasprintf(strp, fmt, args_copy);
         va_end(args_copy);
@@ -288,7 +288,7 @@ x_asprintf(char **strp, const char *file, int line, const char *fmt, ...)
         status = vsnprintf(NULL, 0, fmt, args_copy);
         va_end(args_copy);
         status = (status < 0) ? 0 : status + 1;
-        (*xmalloc_error_handler)("asprintf", status, file, line);
+        xmalloc_error_handler("asprintf", status, file, line);
         va_copy(args_copy, args);
         status = vasprintf(strp, fmt, args_copy);
         va_end(args_copy);
@@ -311,7 +311,7 @@ x_asprintf(char **strp, const char *fmt, ...)
         status = vsnprintf(NULL, 0, fmt, args_copy);
         va_end(args_copy);
         status = (status < 0) ? 0 : status + 1;
-        (*xmalloc_error_handler)("asprintf", status, __FILE__, __LINE__);
+        xmalloc_error_handler("asprintf", status, __FILE__, __LINE__);
         va_copy(args_copy, args);
         status = vasprintf(strp, fmt, args_copy);
         va_end(args_copy);