From: Jérémie Astor Date: Mon, 14 Sep 2020 11:49:58 +0000 (+0200) Subject: :art: do not use asprintf X-Git-Tag: nightly~1307 X-Git-Url: http://10.10.0.4:5575/?a=commitdiff_plain;h=0a2a4cd6e41c4bcd95599ed93097d74c338bb580;p=gwion.git :art: do not use asprintf --- 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