]> Nishi Git Mirror - gwion.git/commitdiff
:art: Improve scan0_sym
authorfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 15 Oct 2019 11:31:26 +0000 (13:31 +0200)
committerfennecdjay <astor.jeremie@wanadoo.fr>
Tue, 15 Oct 2019 11:31:26 +0000 (13:31 +0200)
src/parse/scan0.c

index 1102900d72208ad041bd0cdb81d2e882a8b663b0..e96951448e4f528773faddde4e8e576944f7a3d6 100644 (file)
@@ -191,8 +191,8 @@ ANN m_bool scan0_type_def(const Env env, const Type_Def tdef) {
 ANN static Symbol scan0_sym(const Env env, const m_str name, const loc_t pos) {
   const size_t line_len = num_digit(pos->first_line);
   const size_t col_len = num_digit(pos->first_column);
-  char c[strlen(env->curr->name) + line_len + col_len + strlen(name) + 5];
-  sprintf(c, "@%s:%s:%u:%u", name, env->curr->name,
+  char c[strlen(env->curr->name) + strlen(env->name) + line_len + col_len + strlen(name) + 6];
+  sprintf(c, "@%s:%s:%s:%u:%u", name, env->name, env->curr->name,
       pos->first_line, pos->first_column);
   return insert_symbol(c);
 }