Changeset 9099 for trunk/gtk/tr-window.c


Ignore:
Timestamp:
Sep 11, 2009, 11:43:42 PM (13 years ago)
Author:
charles
Message:

(trunk T) possible fix for gtk crash reported by Michael Stoykov

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/tr-window.c

    r9006 r9099  
    333333    char u[32];
    334334    char d[32];
    335     char buf[128];
     335    char * str;
    336336    const char * fmt;
    337337    const gboolean b = pref_flag_get( TR_PREFS_KEY_ALT_SPEED_ENABLED );
     
    342342    fmt = b ? _( "Click to disable Temporary Speed Limits\n(%1$s down, %2$s up)" )
    343343            : _( "Click to enable Temporary Speed Limits\n(%1$s down, %2$s up)" );
    344     g_snprintf( buf, sizeof( buf ), fmt, d, u );
     344    str = g_strdup_printf( fmt, d, u );
    345345
    346346    gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), b );
    347347    gtk_button_set_image( GTK_BUTTON( w ), p->alt_speed_image[b?1:0] );
    348348    gtk_button_set_alignment( GTK_BUTTON( w ), 0.5, 0.5 );
    349     gtr_widget_set_tooltip_text( w, buf );
     349    gtr_widget_set_tooltip_text( w, str );
     350
     351    g_free( str );
    350352}
    351353
Note: See TracChangeset for help on using the changeset viewer.