diff options
Diffstat (limited to '')
| -rw-r--r-- | src/util/util.c | 4 | ||||
| -rw-r--r-- | src/util/util.h | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/util/util.c b/src/util/util.c index 61c864c..7938f0f 100644 --- a/src/util/util.c +++ b/src/util/util.c | |||
| @@ -54,11 +54,11 @@ void die(const char *format_string, ...) | |||
| 54 | * int *array = ecalloc(10, sizeof(int)); // Allocate memory for an array of | 54 | * int *array = ecalloc(10, sizeof(int)); // Allocate memory for an array of |
| 55 | * 10 integers. | 55 | * 10 integers. |
| 56 | */ | 56 | */ |
| 57 | void *ecalloc(size_t num_elements, size_t element_size) | 57 | void *ecalloc(const size_t num_elements, const size_t element_size) |
| 58 | { | 58 | { |
| 59 | void *allocated_memory; | 59 | void *allocated_memory; |
| 60 | 60 | ||
| 61 | if (!(allocated_memory = calloc(num_elements, element_size))) | 61 | if (!((allocated_memory = calloc(num_elements, element_size)))) |
| 62 | die("calloc:"); | 62 | die("calloc:"); |
| 63 | 63 | ||
| 64 | return allocated_memory; | 64 | return allocated_memory; |
diff --git a/src/util/util.h b/src/util/util.h index 6ef3c86..2c2f773 100644 --- a/src/util/util.h +++ b/src/util/util.h | |||
| @@ -35,7 +35,7 @@ | |||
| 35 | * Usage: | 35 | * Usage: |
| 36 | * die("Error occurred in function %s", __func__); | 36 | * die("Error occurred in function %s", __func__); |
| 37 | */ | 37 | */ |
| 38 | void die(const char *fmt, ...); | 38 | void die(const char *format_string, ...); |
| 39 | 39 | ||
| 40 | /* | 40 | /* |
| 41 | * ecalloc() | 41 | * ecalloc() |
| @@ -56,4 +56,4 @@ void die(const char *fmt, ...); | |||
| 56 | * int *arr = ecalloc(10, sizeof(int)); // Allocate memory for an array of 10 | 56 | * int *arr = ecalloc(10, sizeof(int)); // Allocate memory for an array of 10 |
| 57 | * integers. | 57 | * integers. |
| 58 | */ | 58 | */ |
| 59 | void *ecalloc(size_t nmemb, size_t size); | 59 | void *ecalloc(size_t num_elements, size_t element_size); |
