[gtk] Fix buffer overflow in eclipse finder

Fixes: #935
pull/940/head
Hleb Valoshka 2021-03-30 14:07:40 +03:00
parent 37de4c3784
commit ccd0d64bdc
2 changed files with 3 additions and 3 deletions

View File

@ -51,7 +51,7 @@ void dialogEclipseFinder(AppData* app)
ed->eclipseList = NULL;
ed->eclipseListStore = NULL;
ed->type = Eclipse::Solar;
sprintf(ed->body, "%s", eclipsePlanetTitles[0]);
ed->body = eclipsePlanetTitles[0];
ed->sel = NULL;
ed->window = GTK_DIALOG(gtk_dialog_new_with_buttons("Eclipse Finder",
@ -440,7 +440,7 @@ static void eclipseBodySelect(GtkMenuShell* menu, EclipseData* ed)
int itemIndex = g_list_index(list, item);
/* Set string according to body array */
sprintf(ed->body, "%s", eclipsePlanetTitles[itemIndex]);
ed->body = eclipsePlanetTitles[itemIndex];
}

View File

@ -43,7 +43,7 @@ struct _EclipseData {
selDate* d2;
int type;
char body[7];
const char* body;
GtkTreeSelection* sel;
GtkWidget *eclipseList;