diff --git a/src/actions.c b/src/actions.c index b18a4fec..76744abe 100644 --- a/src/actions.c +++ b/src/actions.c @@ -494,6 +494,7 @@ void saveas(const char *f) /* changed name from ask_save_file to saveas 2012120 my_strncpy(current_name, rel_sym_path(res), S(current_name)); /* 20190519 */ return; } + void ask_new_file(void) { char fullname[PATH_MAX]; /* overflow safe 20161125 */ @@ -528,6 +529,7 @@ void ask_new_file(void) void remove_symbol(int j) { int i,c; + Instdef save; dbg(1, "remove_symbol(): removing symbol %d\n", j); if(instdef[j].prop_ptr != NULL) { my_free(666, &instdef[j].prop_ptr); @@ -598,9 +600,11 @@ void remove_symbol(int j) my_free(683, &instdef[j].txtptr); my_free(684, &instdef[j].name); + save = instdef[j]; for(i = j + 1; i < lastinstdef; i++) { instdef[i-1] = instdef[i]; } + instdef[lastinstdef-1] = save; lastinstdef--; } diff --git a/src/editprop.c b/src/editprop.c index 81c52f4f..5c133961 100644 --- a/src/editprop.c +++ b/src/editprop.c @@ -322,8 +322,8 @@ void my_realloc(int id, void *ptr,size_t size) a = *(void **)ptr; if(size == 0) { free(*(void **)ptr); + dbg(3, "my_free(%d,): my_realloc_freeing %p\n",id, *(void **)ptr); *(void **)ptr=NULL; - dbg(3, "my_free(): my_realloc_freeing %p\n",*(void **)ptr); } else { *(void **)ptr=realloc(*(void **)ptr,size); if(*(void **)ptr == NULL) fprintf(errfp,"my_realloc(%d,): allocation failure\n", id); @@ -340,7 +340,7 @@ void my_free(int id, void *ptr) dbg(3, "my_free(%d,): freeing %p\n", id, *(void **)ptr); *(void **)ptr=NULL; } else { - dbg(3, "my_free(%d,): trying to free NULL pointer\n", id); + dbg(3, "--> my_free(%d,): trying to free NULL pointer\n", id); } } diff --git a/src/hilight.c b/src/hilight.c index 0afe1004..a5207431 100644 --- a/src/hilight.c +++ b/src/hilight.c @@ -24,7 +24,6 @@ static struct hilight_hashentry *hilight_table[HASHSIZE]; static int nelements=0; /* 20161221 */ - static int *inst_color=NULL; static unsigned int hash(char *tok) @@ -295,6 +294,7 @@ void delete_hilight_net(void) for(i=0;i