From 32c1fbd2cf779a65e807d0d82412ffffa2401962 Mon Sep 17 00:00:00 2001 From: Aleksey Veresov Date: Fri, 15 Nov 2019 18:01:45 +0300 Subject: [magi] --- src/utils.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/utils.c') diff --git a/src/utils.c b/src/utils.c index 4212561..01969a2 100644 --- a/src/utils.c +++ b/src/utils.c @@ -1,5 +1,6 @@ #include "utils.h" +#include "error.h" #include #include @@ -22,7 +23,7 @@ char * magi_str_create_copy(const char * begin, const char * end) memcpy(res, begin, end - begin); res[end - begin] = 0; } else { - magi_log("Cannot allocate string."); + magi_error_set("Cannot allocate string."); } return res; } @@ -33,7 +34,7 @@ char * magi_str_create(int len) if (str) { str[len] = 0; } else { - magi_log("Cannot allocate string."); + magi_error_set("Cannot allocate string."); } return str; } @@ -47,7 +48,7 @@ int magi_str_add(char ** dest, int * len, int * size, char c) } if (*dest == 0) { ok = 0; - magi_log("Cannot allocate string."); + magi_error_set("Cannot allocate string."); } else { (*dest)[*len] = c; ++*len; -- cgit v1.2.3