From: <des...@us...> - 2003-12-26 15:56:01
|
Update of /cvsroot/beepmp/bmp/beep In directory sc8-pr-cvs1:/tmp/cvs-serv3847 Modified Files: equalizer.c main.c output.c prefswin.c Log Message: - replaced sprintf()s with snprintf()s Index: equalizer.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/equalizer.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** equalizer.c 26 Dec 2003 08:30:15 -0000 1.11 --- equalizer.c 26 Dec 2003 15:55:56 -0000 1.12 *************** *** 1077,1081 **** for (i = 0; i < 10; i++) { gchar tmp[7]; ! sprintf(tmp, "Band%d", i); if (xmms_cfg_read_float(cfgfile, "Equalizer preset", tmp, &val)) eqslider_set_position(equalizerwin_bands[i], val); --- 1077,1081 ---- for (i = 0; i < 10; i++) { gchar tmp[7]; ! g_snprintf(tmp, sizeof(tmp), "Band%d", i); if (xmms_cfg_read_float(cfgfile, "Equalizer preset", tmp, &val)) eqslider_set_position(equalizerwin_bands[i], val); *************** *** 1298,1302 **** for (i = 0; i < 10; i++) { gchar tmp[7]; ! sprintf(tmp, "Band%d", i); xmms_cfg_write_float(cfgfile, "Equalizer preset", tmp, eqslider_get_position(equalizerwin_bands[i])); --- 1298,1302 ---- for (i = 0; i < 10; i++) { gchar tmp[7]; ! g_snprintf(tmp, sizeof(tmp), "Band%d", i); xmms_cfg_write_float(cfgfile, "Equalizer preset", tmp, eqslider_get_position(equalizerwin_bands[i])); Index: main.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/main.c,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** main.c 26 Dec 2003 08:30:15 -0000 1.28 --- main.c 26 Dec 2003 15:55:56 -0000 1.29 *************** *** 291,295 **** gchar eqtext[18]; ! g_sprintf(eqtext, "equalizer_band%d", i); xmms_cfg_read_float(cfgfile, "xmms", eqtext, &cfg.equalizer_bands[i]); --- 291,295 ---- gchar eqtext[18]; ! g_snprintf(eqtext, sizeof(eqtext), "equalizer_band%d", i); xmms_cfg_read_float(cfgfile, "xmms", eqtext, &cfg.equalizer_bands[i]); *************** *** 336,340 **** gchar str[19], *temp; ! g_sprintf(str, "url_history%d", i); if (xmms_cfg_read_string(cfgfile, "xmms", str, &temp)) cfg.url_history = g_list_append(cfg.url_history, temp); --- 336,340 ---- gchar str[19], *temp; ! g_snprintf(str, sizeof(str), "url_history%d", i); if (xmms_cfg_read_string(cfgfile, "xmms", str, &temp)) cfg.url_history = g_list_append(cfg.url_history, temp); Index: output.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/output.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** output.c 26 Dec 2003 08:30:16 -0000 1.6 --- output.c 26 Dec 2003 15:55:56 -0000 1.7 *************** *** 54,58 **** pos = get_playlist_position(); time = input_get_time() / 1000; ! sprintf(timestr, "%u:%2.2u", time / 60, time % 60); params = sscanf(timestr, "%u:%u", &min, &sec); --- 54,59 ---- pos = get_playlist_position(); time = input_get_time() / 1000; ! g_snprintf(timestr, sizeof(timestr), "%u:%2.2u", ! time / 60, time % 60); params = sscanf(timestr, "%u:%u", &min, &sec); Index: prefswin.c =================================================================== RCS file: /cvsroot/beepmp/bmp/beep/prefswin.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** prefswin.c 26 Dec 2003 15:47:45 -0000 1.9 --- prefswin.c 26 Dec 2003 15:55:56 -0000 1.10 *************** *** 430,434 **** save_config(); ! // FIXME: It's _very_ slow doing this again for say several hundred or thousand files... playlist_read_info_selection(); playlistwin_update_list(); --- 430,435 ---- save_config(); ! /* FIXME: It's _very_ slow doing this again for say several ! * hundred or thousand files... */ playlist_read_info_selection(); playlistwin_update_list(); *************** *** 442,446 **** void prefswin_ok_cb(GtkWidget * w, gpointer data) { ! // prefswin_apply_changes(); gtk_widget_hide(prefswin); } --- 443,447 ---- void prefswin_ok_cb(GtkWidget * w, gpointer data) { ! /* prefswin_apply_changes(); */ gtk_widget_hide(prefswin); } *************** *** 458,466 **** void prefswin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel; gint response; gchar *fontname; ! if (fontsel != NULL) return; --- 459,467 ---- void prefswin_font_browse_cb(GtkWidget * w, gpointer data) { ! static GtkWidget *fontsel = NULL; gint response; gchar *fontname; ! if (fontsel) return; *************** *** 1713,1717 **** void __show_prefs_window(void) { ! char temp[10]; if (GTK_WIDGET_VISIBLE(prefswin)) { --- 1714,1718 ---- void __show_prefs_window(void) { ! gchar temp[10]; if (GTK_WIDGET_VISIBLE(prefswin)) { *************** *** 1727,1731 **** gtk_entry_set_text(GTK_ENTRY(prefswin_options_sd_entry), temp); prefswin_options_read_data(); ! sprintf(temp, "%u", cfg.pause_between_songs_time); gtk_entry_set_text(GTK_ENTRY(prefswin_options_pbs_entry), temp); gtk_spin_button_set_value(GTK_SPIN_BUTTON(prefswin_options_mouse_spin), --- 1728,1732 ---- gtk_entry_set_text(GTK_ENTRY(prefswin_options_sd_entry), temp); prefswin_options_read_data(); ! g_snprintf(temp, sizeof(temp), "%u", cfg.pause_between_songs_time); gtk_entry_set_text(GTK_ENTRY(prefswin_options_pbs_entry), temp); gtk_spin_button_set_value(GTK_SPIN_BUTTON(prefswin_options_mouse_spin), |