diff options
Diffstat (limited to '')
-rw-r--r-- | src/mds-kbdc/builtin-functions.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mds-kbdc/builtin-functions.c b/src/mds-kbdc/builtin-functions.c index fbff16f..7cd13b7 100644 --- a/src/mds-kbdc/builtin-functions.c +++ b/src/mds-kbdc/builtin-functions.c @@ -29,24 +29,24 @@ /** * Define useful data for built-in function with 2 parameters */ -#define define_2 \ - const char32_t* restrict a = *args++; \ - const char32_t* restrict b = *args++; \ - size_t an = string_length(a); \ - size_t bn = string_length(b); \ - size_t i, n = an > bn ? an : bn; \ - char32_t* restrict rc = malloc((n + 1) * sizeof(char32_t)); \ - fail_if (rc == NULL); \ +#define define_2 \ + const char32_t* restrict a = *args++; \ + const char32_t* restrict b = *args++; \ + size_t an = string_length(a); \ + size_t bn = string_length(b); \ + size_t i, n = an > bn ? an : bn; \ + char32_t* restrict rc; \ + fail_if (xmalloc(rc, n + 1, char32_t)); \ rc[n] = -1 /** * Define useful data for built-in function with 1 parameter */ -#define define_1 \ - const char32_t* restrict a = *args++; \ - size_t i, n = string_length(a); \ - char32_t* restrict rc = malloc((n + 1) * sizeof(char32_t)); \ - fail_if (rc == NULL); \ +#define define_1 \ + const char32_t* restrict a = *args++; \ + size_t i, n = string_length(a); \ + char32_t* restrict rc; \ + fail_if (xmalloc(rc, n + 1, char32_t)); \ rc[n] = -1 /** |