diff --git a/src/token.c b/src/token.c index 03ddfc4b..24b1a28c 100644 --- a/src/token.c +++ b/src/token.c @@ -5289,14 +5289,19 @@ const char *translate(int inst, const char *s) } token_pos = 0; if(c == '@' || c == '%') s--; - else result[result_pos++]=(char)c; + else { + STR_ALLOC(&result, 1 + result_pos, &size); + result[result_pos++]=(char)c; + } state=TOK_BEGIN; } /* else if(state==TOK_SEP) */ else if(state==TOK_BEGIN) { + STR_ALLOC(&result, 1 + result_pos, &size); result[result_pos++]=(char)c; } if(c=='\0') { + STR_ALLOC(&result, 1 + result_pos, &size); result[result_pos]='\0'; break; } diff --git a/src/xinit.c b/src/xinit.c index b22808a8..741823db 100644 --- a/src/xinit.c +++ b/src/xinit.c @@ -3211,6 +3211,10 @@ int Tcl_AppInit(Tcl_Interp *inter) if(cli_opt_do_netlist) set_modify(-1); /* set tab/window title */ } xctx->pending_fullzoom=1; + /* necessary if the dialog to allow tcl scripts in schematics is shown. + * the dialog sets semaphore to 3 to avoid nested calls, so some ConfigureNotify events and resetwindow + * calls are lost */ + resetwin(1, 0, 0, 0, 0); if(has_x) tclvareval("set_geom . [xschem get current_name]", NULL); if(cli_opt_do_netlist) {