Counting is hard

When updating the "You have usnaved change..." string I didn't pay
attention and missed the fact that we used it's hard coded length above to
allocate a large enough buffer.

Thanks you, Valgrind.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2012-09-29 20:15:13 -07:00
parent 82abbf5904
commit 12ca6112e5

View file

@ -231,7 +231,7 @@ static gboolean ask_save_changes()
label = gtk_label_new (
"You have unsaved changes\nWould you like to save those before closing the datafile?");
} else {
char *label_text = (char*) malloc(sizeof(char) * (93 + strlen(existing_filename)));
char *label_text = (char*) malloc(sizeof(char) * (94 + strlen(existing_filename)));
sprintf(label_text,
"You have unsaved changes to file: %s \nWould you like to save those before closing the datafile?",
existing_filename);