[gtk] Fix buffer overflow in eclipse finder

pull/1018/head
Hleb Valoshka 2021-03-30 14:11:42 +03:00
parent da7cd6fd60
commit ba3138a098
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ void dialogEclipseFinder(AppData* app)
ed->eclipseList = NULL;
ed->eclipseListStore = NULL;
ed->bSolar = TRUE;
sprintf(ed->body, "%s", eclipsePlanetTitles[0]);
ed->body = eclipsePlanetTitles[0];
ed->sel = NULL;
ed->window = GTK_DIALOG(gtk_dialog_new_with_buttons(_("Eclipse Finder"),
@ -426,7 +426,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;
bool bSolar;
char body[7];
const char* body;
GtkTreeSelection* sel;
GtkWidget *eclipseList;