mirror of
https://github.com/nmap/nmap.git
synced 2025-12-10 09:49:05 +00:00
Indentation fixes:
$ indent -nut -i2 -kr -br -brs -brf -l0 -bad -npcs -nprs -ncs nbase_memalloc.c
This commit is contained in:
@@ -99,23 +99,23 @@
|
||||
#include "nbase.h"
|
||||
#include <stdio.h>
|
||||
|
||||
static void fatal(char *fmt, ...) __attribute__ ((format (printf, 1, 2)));
|
||||
static void fatal(char *fmt, ...) __attribute__ ((format(printf, 1, 2)));
|
||||
|
||||
static void fatal(char *fmt, ...)
|
||||
{
|
||||
va_list ap;
|
||||
va_start(ap, fmt);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\nQUITTING!\n");
|
||||
va_end(ap);
|
||||
exit(1);
|
||||
static void fatal(char *fmt, ...) {
|
||||
va_list ap;
|
||||
|
||||
va_start(ap, fmt);
|
||||
fflush(stdout);
|
||||
vfprintf(stderr, fmt, ap);
|
||||
fprintf(stderr, "\nQUITTING!\n");
|
||||
va_end(ap);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
void *safe_malloc(size_t size)
|
||||
{
|
||||
void *safe_malloc(size_t size) {
|
||||
void *mymem;
|
||||
if ((int) size < 0) /* Catch caller errors */
|
||||
|
||||
if ((int)size < 0) /* Catch caller errors */
|
||||
fatal("Tried to malloc negative amount of memory!!!");
|
||||
mymem = malloc(size);
|
||||
if (mymem == NULL)
|
||||
@@ -123,10 +123,10 @@ void *safe_malloc(size_t size)
|
||||
return mymem;
|
||||
}
|
||||
|
||||
void *safe_realloc(void *ptr, size_t size)
|
||||
{
|
||||
void *safe_realloc(void *ptr, size_t size) {
|
||||
void *mymem;
|
||||
if ((int) size < 0) /* Catch caller errors */
|
||||
|
||||
if ((int)size < 0) /* Catch caller errors */
|
||||
fatal("Tried to realloc negative amount of memory!!!");
|
||||
mymem = realloc(ptr, size);
|
||||
if (mymem == NULL)
|
||||
@@ -135,10 +135,10 @@ void *safe_realloc(void *ptr, size_t size)
|
||||
}
|
||||
|
||||
/* Zero-initializing version of safe_malloc */
|
||||
void *safe_zalloc(size_t size)
|
||||
{
|
||||
void *safe_zalloc(size_t size) {
|
||||
void *mymem;
|
||||
if ((int) size < 0)
|
||||
|
||||
if ((int)size < 0)
|
||||
fatal("Tried to malloc negative amount of memory!!!");
|
||||
mymem = calloc(1, size);
|
||||
if (mymem == NULL)
|
||||
|
||||
Reference in New Issue
Block a user