Change a few g_string_append_printf() (GTK2 only) calls to g_strdup_printf()
authorsfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 30 Oct 2007 05:49:41 +0000 (05:49 +0000)
committersfisher <sfisher@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 30 Oct 2007 05:49:41 +0000 (05:49 +0000)
and g_string_append() to work on GTK 1.2 also.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23311 f5534014-38df-0310-8fa8-9805f1628bb7

plugins/wimaxasncp/wimaxasncp_dict.l

index 8f63dfa3e867f04b258e55eb675dc7aacf5484a1..2b7b69d6157c91bda74e12a100ab4dd56068fd66 100644 (file)
@@ -252,7 +252,7 @@ decoder_attr decoder=\042
 <LOADING>{any} APPEND(yytext,yyleng);
 
 <LOADING,IN_DICT>{entity} {
-       gchar *p = ++yytext;
+       gchar *p = ++yytext, *temp_str;
        entity_t* e;
        
        while(*p != ';') p++;
@@ -262,7 +262,7 @@ decoder_attr decoder=\042
        D(("looking for entity: %s\n",yytext));
 
        if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
-               g_string_append_printf(
+               dict_error = g_string_append(
                        dict_error, "included files nested too deeply\n");
                yyterminate();
        }
@@ -284,8 +284,10 @@ decoder_attr decoder=\042
        }
        
        if (!e) {
-               g_string_append_printf(
-                       dict_error, "cannot find entity: '%s'\n", e->name);
+               temp_str = g_strdup_printf(
+                       "cannot find entity: '%s'\n", e->name);
+               dict_error = g_string_append(dict_error, temp_str);
+               g_free(temp_str);
                yyterminate();
        }
        
@@ -567,7 +569,7 @@ static FILE *wimaxasncp_dict_open(
        const gchar *filename) 
 {
        FILE *fh;
-       gchar *fname;
+       gchar *fname, *temp_str;
        if (system_directory) 
        {
                int len =  strlen(system_directory) + strlen(filename) 
@@ -587,11 +589,13 @@ static FILE *wimaxasncp_dict_open(
 
        if ( ! fh)
        {
-               g_string_append_printf(
-                       dict_error,
+               temp_str = g_strdup_printf(
                        "cannot open file: '%s', error: %s\n",
                        fname,
                        g_strerror(errno));
+               
+               dict_error = g_string_append(dict_error, temp_str);
+               g_free(temp_str);
        }
 
        g_free(fname);