From 0a2a4cd6e41c4bcd95599ed93097d74c338bb580 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Astor?= Date: Mon, 14 Sep 2020 13:49:58 +0200 Subject: [PATCH] :art: do not use asprintf --- src/lib/lib_func.c | 6 +++--- util | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/lib_func.c b/src/lib/lib_func.c index da0f8586..8632498f 100644 --- a/src/lib/lib_func.c +++ b/src/lib/lib_func.c @@ -201,10 +201,10 @@ static OP_CHECK(opck_auto_fptr) { // TODO: we could check first if there a matching existing one Func_Base *const fbase = cpy_func_base(env->gwion->mp, bin->lhs->info->type->e->d.func->def->base); const Fptr_Def fptr_def = new_fptr_def(env->gwion->mp, fbase, bin->lhs->info->type->e->d.func->def->flag); - m_str name = NULL; - asprintf(&name, "generated@%u:%u", bin->rhs->pos->first.line, bin->rhs->pos->first.column); + char name[13 + strlen(env->curr->name) + + num_digit(bin->rhs->pos->first.line) + num_digit(bin->rhs->pos->first.column)]; + sprintf(name, "generated@%s@%u:%u", env->curr->name, bin->rhs->pos->first.line, bin->rhs->pos->first.column); fptr_def->base->xid = insert_symbol(name); - free(name); const m_bool ret = traverse_fptr_def(env, fptr_def); const Type t = fptr_def->type; free_fptr_def(env->gwion->mp, fptr_def); diff --git a/util b/util index 9de9e5f7..8a433d32 160000 --- a/util +++ b/util @@ -1 +1 @@ -Subproject commit 9de9e5f76f54308e8240114a6c8260fcb442f6dd +Subproject commit 8a433d3220026c2819e3e27d00e014c6b73b5def -- 2.43.0