summaryrefslogtreecommitdiff
path: root/robot/errcatch.c
diff options
context:
space:
mode:
Diffstat (limited to 'robot/errcatch.c')
-rw-r--r--robot/errcatch.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/robot/errcatch.c b/robot/errcatch.c
index f66b2a1..82da820 100644
--- a/robot/errcatch.c
+++ b/robot/errcatch.c
@@ -1,4 +1,3 @@
-#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -31,7 +30,7 @@ void w2_errcatch_main() {
}
w2_s_error *w2_alloc_error(enum w2_e_errorcodes code, uint16_t length, const char *message) {
- w2_s_error *error = calloc(sizeof(w2_s_error) + length, 1);
+ w2_s_error *error = malloc(sizeof(w2_s_error) + length);
memcpy(error, &(w2_s_error const){.code = code, .message_length = length}, sizeof(w2_s_error));
strncpy(error->message, message, length);