1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-11 02:09:03 +00:00

Indentation fixes:

$ indent -nut -i2 -kr -br -brs -brf -l0 -bad -npcs -nprs -ncs nbase_memalloc.c
This commit is contained in:
henri
2012-09-10 08:20:25 +00:00
parent 0674925f73
commit 0f521a8697

View File

@@ -101,9 +101,9 @@
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, ...) static void fatal(char *fmt, ...) {
{
va_list ap; va_list ap;
va_start(ap, fmt); va_start(ap, fmt);
fflush(stdout); fflush(stdout);
vfprintf(stderr, fmt, ap); vfprintf(stderr, fmt, ap);
@@ -112,9 +112,9 @@ va_end(ap);
exit(1); exit(1);
} }
void *safe_malloc(size_t size) void *safe_malloc(size_t size) {
{
void *mymem; void *mymem;
if ((int)size < 0) /* Catch caller errors */ if ((int)size < 0) /* Catch caller errors */
fatal("Tried to malloc negative amount of memory!!!"); fatal("Tried to malloc negative amount of memory!!!");
mymem = malloc(size); mymem = malloc(size);
@@ -123,9 +123,9 @@ void *safe_malloc(size_t size)
return mymem; return mymem;
} }
void *safe_realloc(void *ptr, size_t size) void *safe_realloc(void *ptr, size_t size) {
{
void *mymem; void *mymem;
if ((int)size < 0) /* Catch caller errors */ if ((int)size < 0) /* Catch caller errors */
fatal("Tried to realloc negative amount of memory!!!"); fatal("Tried to realloc negative amount of memory!!!");
mymem = realloc(ptr, size); mymem = realloc(ptr, size);
@@ -135,9 +135,9 @@ void *safe_realloc(void *ptr, size_t size)
} }
/* Zero-initializing version of safe_malloc */ /* Zero-initializing version of safe_malloc */
void *safe_zalloc(size_t size) void *safe_zalloc(size_t size) {
{
void *mymem; void *mymem;
if ((int)size < 0) if ((int)size < 0)
fatal("Tried to malloc negative amount of memory!!!"); fatal("Tried to malloc negative amount of memory!!!");
mymem = calloc(1, size); mymem = calloc(1, size);