Merge pull request #5 from dnet/strcmp-null-segfault

fixed segfault when calling strcmp with NULL
pull/7/head
Oona Räisänen 2015-04-14 21:16:34 +03:00
commit 8f01dab168
1 zmienionych plików z 2 dodań i 1 usunięć

3
pcm.c
Wyświetl plik

@ -82,7 +82,8 @@ void populateDeviceList() {
snd_card_get_name(card,&cardname);
gdk_threads_enter();
gtk_combo_box_text_append_text(GTK_COMBO_BOX_TEXT(gui.combo_card), cardname);
if (strcmp(cardname,g_key_file_get_string(config,"slowrx","device",NULL)) == 0)
char *dev = g_key_file_get_string(config,"slowrx","device",NULL);
if (dev == NULL || strcmp(cardname, dev) == 0)
gtk_combo_box_set_active(GTK_COMBO_BOX(gui.combo_card), row);
gdk_threads_leave();