g_string_sprintf --> g_string_printf and g_string_sprintfa --> g_string_append_printf
authorwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 11 May 2008 18:33:49 +0000 (18:33 +0000)
committerwmeier <wmeier@f5534014-38df-0310-8fa8-9805f1628bb7>
Sun, 11 May 2008 18:33:49 +0000 (18:33 +0000)
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@25276 f5534014-38df-0310-8fa8-9805f1628bb7

14 files changed:
asn1/pkcs12/packet-pkcs12-template.c
capture-pcap-util-unix.c
epan/dfilter/dfilter-macro.c
epan/dtd_grammar.lemon
epan/dtd_parse.l
epan/dtd_preparse.l
epan/radius_dict.l
epan/wslua/wslua_field.c
epan/wslua/wslua_proto.c
gtk/capture_if_details_dlg_win32.c
plugins/mate/mate_grammar.lemon
plugins/mate/mate_parser.l
plugins/mate/mate_setup.c
plugins/mate/mate_util.c

index 41bf1258697a7f637bdd77092ceb9a3c89cd7f3d..49472ba5d4d878260e1acb47b1429393d97b8b1d 100644 (file)
@@ -365,7 +365,7 @@ int PBE_decrypt_data(const char *object_identifier_id _U_, tvbuff_t *encrypted_t
 
        name = g_string_new("");
        oidname = oid_resolved_from_string(object_identifier_id);
-       g_string_sprintf(name, "Decrypted %s", oidname ? oidname : object_identifier_id);
+       g_string_printf(name, "Decrypted %s", oidname ? oidname : object_identifier_id);
 
        /* add it as a new source */
        add_new_data_source(actx->pinfo, clear_tvb, name->str);
index 26a45da0b1f3544f6505157b220bd0f37a73b0f6..390b4d763ce7f84977a8a0e114cf07ef228e70d1 100644 (file)
@@ -359,7 +359,7 @@ get_runtime_pcap_version(GString *str)
 {
        g_string_append_printf(str, "with ");
 #ifdef HAVE_PCAP_LIB_VERSION
-       g_string_sprintfa(str, pcap_lib_version());
+       g_string_append_printf(str, pcap_lib_version());
 #else
        g_string_append(str, "libpcap (version unknown)");
 #endif
index 179a5f00a32bc4fa02ea88f5a3c8ef1620665583..4242c833cdd887dc9a24c96432aa20d2a0827494 100644 (file)
@@ -202,9 +202,9 @@ static gchar* dfilter_macro_resolve(gchar* name, gchar** args, const gchar** err
 
        if (args) {
                while (*parts) {
-                       g_string_sprintfa(text,"%s%s",
-                                                 args[*(arg_pos_p++)],
-                                                 *(parts++));
+                       g_string_append_printf(text,"%s%s",
+                                              args[*(arg_pos_p++)],
+                                              *(parts++));
                }
        }
 
index 1b56e52a3d879f12ed493b0f846cf4d09b7abdac..3fc63e2e5517a29e8b474889e52fec013b5c563f 100644 (file)
@@ -69,13 +69,13 @@ static GPtrArray* g_ptr_array_join(GPtrArray* a, GPtrArray* b){
 
 %syntax_error {
        if (!TOKEN)
-               g_string_sprintfa(bd->error,"syntax error at end of file");
+               g_string_append_printf(bd->error,"syntax error at end of file");
        else 
-               g_string_sprintfa(bd->error,"syntax error in %s at or before '%s': \n", TOKEN->location,TOKEN->text);
+               g_string_append_printf(bd->error,"syntax error in %s at or before '%s': \n", TOKEN->location,TOKEN->text);
 }
 
 %parse_failure {
-       g_string_sprintfa(bd->error,"DTD parsing failure\n");
+       g_string_append_printf(bd->error,"DTD parsing failure\n");
 }
 
 %token_prefix TOKEN_
index 4556a058581326d59f2cd37ae20fcd7d0f8b1562..05c8a611b8279fcf4e2de9dba9ae54105752e08e 100644 (file)
@@ -218,7 +218,7 @@ squoted        ['][^\']*[']
 <GET_ATTR_QUOTE>{get_attr_quote} { BEGIN GET_ATTR_VAL; }
 
 <GET_ATTR_QUOTE>. {
-       g_string_sprintfa(build_data->error,
+       g_string_append_printf(build_data->error,
                                        "error in wireshark:protocol xmpli at %s : could not find attribute value!",
                                        location);
        yyterminate();
@@ -238,7 +238,7 @@ squoted        ['][^\']*[']
        }
        
        if (! got_it) {
-               g_string_sprintfa(build_data->error,
+               g_string_append_printf(build_data->error,
                                                "error in wireshark:protocol xmpli at %s : no such parameter %s!",
                                                location, attr_name);
                g_free(attr_name);
index 7a8fa5e8d0efb5153267aaa1a03d990b578b6f81..93257183899c7ed595ef6335fcc486fe721c2812 100644 (file)
@@ -122,7 +122,7 @@ newline    \n
 %%
 
 
-{entity}                                               if (current) g_string_sprintfa(current,"%s\n%s\n",replace_entity(yytext),location());
+{entity}                                               if (current) g_string_append_printf(current,"%s\n%s\n",replace_entity(yytext),location());
 
 {whitespace}                                   if (current) g_string_append(current," ");
 
@@ -138,7 +138,7 @@ newline    \n
        
 {newline}                                              {
        linenum++;
-       if (current) g_string_sprintfa(current,"%s\n",location());
+       if (current) g_string_append_printf(current,"%s\n",location());
 }
 
 
@@ -150,7 +150,7 @@ newline    \n
 <IN_QUOTE>{non_quote}                  |
 <IN_QUOTE>{escaped_quote}              g_string_append(current,yytext);
 <NAMED_ENTITY>{system}                 {
-    g_string_sprintfa(error,"at %s:%u: file inclusion is not supported!", filename, linenum);
+    g_string_append_printf(error,"at %s:%u: file inclusion is not supported!", filename, linenum);
     yyterminate();
 }
 <ENTITY_DONE>{special_stop}            { current = output; g_string_append(current,"\n"); BEGIN OUTSIDE; }
@@ -167,7 +167,7 @@ static gchar* replace_entity(gchar* entity) {
        if (replacement) {
                return replacement->str;
        } else {
-               g_string_sprintfa(error,"dtd_preparse: in file '%s': entity %s does not exists\n", filename, entity);
+               g_string_append_printf(error,"dtd_preparse: in file '%s': entity %s does not exists\n", filename, entity);
                return "";
        }
        
@@ -200,7 +200,7 @@ extern GString* dtd_preparse(const gchar* dname,const  gchar* fname, GString* er
        
        if (!yyin) {
                if (err)
-                       g_string_sprintfa(err, "Could not open file: '%s', error: %s",fullname,strerror(errno));
+                       g_string_append_printf(err, "Could not open file: '%s', error: %s",fullname,strerror(errno));
                        
                return NULL;
        }
index 5fc91d07004c6177e56f4f248aff8e63d22a3443..6ae96231391b090e4d4464b3a4092f2ab3cc7eab 100644 (file)
 
 <INCLUDE>[^[:blank:]\n]+   {
        if ( include_stack_ptr >= MAX_INCLUDE_DEPTH ) {
-               g_string_sprintfa(error, "$INCLUDE files nested to deeply\n");
+               g_string_append_printf(error, "$INCLUDE files nested to deeply\n");
                yyterminate();
        }
 
 
        if (!yyin) {
                if (errno) {
-                       g_string_sprintfa(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) );
+                       g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) );
                        yyterminate();
                }
        } else {
@@ -258,7 +258,7 @@ void add_attribute(const gchar* name, const  gchar* code, radius_attr_dissector_
                v = g_hash_table_lookup(dict->vendors_by_name,vendor_name);
 
                if (! v) {
-                       g_string_sprintfa(error, "Vendor: '%s', does not exist in %s:%i \n", vendor_name, fullpaths[include_stack_ptr], linenums[include_stack_ptr] );
+                       g_string_append_printf(error, "Vendor: '%s', does not exist in %s:%i \n", vendor_name, fullpaths[include_stack_ptr], linenums[include_stack_ptr] );
                        BEGIN JUNK;
                        return;
                } else {
@@ -385,7 +385,7 @@ gboolean radius_load_dictionary (radius_dictionary_t* d, gchar* dir, const gchar
        yyin = eth_fopen(fullpaths[include_stack_ptr],"r");
 
        if (!yyin) {
-               g_string_sprintfa(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) );
+               g_string_append_printf(error, "Could not open file: '%s', error: %s\n", fullpaths[include_stack_ptr], strerror(errno) );
                g_free(fullpaths[include_stack_ptr]);
                *err_str = error->str;
                g_string_free(error,FALSE);
index 209e47df5e757bcbfdc7d7efa5e75cec5850f51c..30220d705737e95ef5c2ece98ab994ff8dca8f06 100644 (file)
@@ -343,7 +343,7 @@ void lua_prime_all_fields(proto_tree* tree _U_) {
 
         g_free(name);
 
-        g_string_sprintfa(fake_tap_filter," || %s",(*f)->abbrev);
+        g_string_append_printf(fake_tap_filter," || %s",(*f)->abbrev);
         fake_tap = TRUE;
     }
 
index 28cf501843e9514dc30d241eb9d960db19492dfa..d4424e528cd77a93887340ae8d81799c2f39fa83 100644 (file)
@@ -1604,7 +1604,7 @@ WSLUA_METAMETHOD DissectorTable_tostring(lua_State* L) {
     switch(type) {
         case FT_STRING:
         {
-            g_string_sprintfa(s,"%s String:\n",dt->name);
+            g_string_append_printf(s,"%s String:\n",dt->name);
             break;
         }
         case FT_UINT8:
@@ -1613,7 +1613,7 @@ WSLUA_METAMETHOD DissectorTable_tostring(lua_State* L) {
         case FT_UINT32:
         {
             int base = get_dissector_table_base(dt->name);
-            g_string_sprintfa(s,"%s Integer(%i):\n",dt->name,base);
+            g_string_append_printf(s,"%s Integer(%i):\n",dt->name,base);
             break;
         }
         default:
index 55191a9e31ec1cd200e953a723a883cb72e2a23a..2a99784a1e9945a24739fe6c02bb93370edaa89c 100644 (file)
@@ -952,9 +952,9 @@ rates_details(unsigned char *values, int length) {
                 /* reduce the screen estate by showing fractions only where required */
                 int_value = (int)float_value;
                 if(float_value == (float)int_value) {
-                    g_string_sprintfa(Rates, "%.0f", float_value);
+                    g_string_append_printf(Rates, "%.0f", float_value);
                 } else {
-                    g_string_sprintfa(Rates, "%.1f", float_value);
+                    g_string_append_printf(Rates, "%.1f", float_value);
                 }
             }
             i++;
index 6426bcd518b2dbf585e94d133206f47d00f8ec6c..97c5ba5f6c5d1575506e0728796889528d610fbe 100644 (file)
@@ -98,10 +98,10 @@ static void configuration_error(mate_config* mc, const gchar* fmt, ...) {
                
                current_frame = g_ptr_array_index(mc->config_stack,(guint)i);
                
-               g_string_sprintfa(mc->config_error,"%s%s at line %u",incl, current_frame->filename, current_frame->linenum);
+               g_string_append_printf(mc->config_error,"%s%s at line %u",incl, current_frame->filename, current_frame->linenum);
        }
        
-       g_string_sprintfa(mc->config_error,": %s\n",error_buffer);
+       g_string_append_printf(mc->config_error,": %s\n",error_buffer);
        
        THROW(MateConfigError);
 
@@ -157,7 +157,7 @@ static gchar* recolonize(mate_config* mc, gchar* s) {
                        configuration_error(mc,"bad token %s",s);
                }
                
-               g_string_sprintfa(str,":%.2X",v);                                       
+               g_string_append_printf(str,":%.2X",v);                                  
        }
        
        g_strfreev(vec);
@@ -425,7 +425,7 @@ pdu_decl ::=
        cfg->discard = DistcardPduData;
        cfg->drop_unassigned = DropUnassigned;
        
-       g_string_sprintfa(mc->protos_filter,"||%s",Field->abbrev);
+       g_string_append_printf(mc->protos_filter,"||%s",Field->abbrev);
 
        /* flip the transport_stack */
        for (i = Stack->len - 1; Stack->len; i--) {
@@ -494,7 +494,7 @@ last_extracted_statement(A) ::= . { A = mc->defaults.pdu.last_extracted; }
 proto_stack(A) ::= proto_stack(B) SLASH field(C). {
        int* hfidp = g_malloc(sizeof(int));
 
-       g_string_sprintfa(mc->fields_filter,"||%s",C->abbrev);
+       g_string_append_printf(mc->fields_filter,"||%s",C->abbrev);
        
        *hfidp = C->id;
        g_ptr_array_add(B,hfidp);
@@ -505,7 +505,7 @@ proto_stack(A) ::= field(B). {
        int* hfidp = g_malloc(sizeof(int));
        *hfidp = B->id;
        
-       g_string_sprintfa(mc->fields_filter,"||%s",B->abbrev);
+       g_string_append_printf(mc->fields_filter,"||%s",B->abbrev);
 
        A = g_ptr_array_new();
        g_ptr_array_add(A,hfidp);
index 31d2fa4b8818b2c8f4ef11b650c57546e2a727d1..0a284a4a45342d04308a7dfb58a33642b435d2c6 100644 (file)
@@ -182,7 +182,7 @@ blk_cmnt_stop  "*/"
                yy_switch_to_buffer(include_stack[--include_stack_ptr] );
                
                if (errno)
-                       g_string_sprintfa(mc->config_error, "Mate parser: Could not open file: '%s': %s", yytext, strerror(errno) );
+                       g_string_append_printf(mc->config_error, "Mate parser: Could not open file: '%s': %s", yytext, strerror(errno) );
                
        } else {
                
@@ -292,7 +292,7 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) {
        yyin = eth_fopen(filename,"r");
        
        if (!yyin) {
-               g_string_sprintfa(mc->config_error,"Mate parser: Could not open file: '%s', error: %s", filename, strerror(errno) );
+               g_string_append_printf(mc->config_error,"Mate parser: Could not open file: '%s', error: %s", filename, strerror(errno) );
                return FALSE;
        }
        
@@ -327,7 +327,7 @@ extern gboolean mate_load_config(const gchar* filename, mate_config* matecfg) {
                state = FALSE;
        } CATCH_ALL {
                state = FALSE;          
-               g_string_sprintfa(mc->config_error,"An unexpected error occurred");
+               g_string_append_printf(mc->config_error,"An unexpected error occurred");
        }
        ENDTRY;
        
index c496aea40d68d6138acc2afbd86cae80046f4059..4d999f8f399bd7b1bdfd5038745b055c6c56b1e5 100644 (file)
@@ -203,7 +203,7 @@ extern gchar* add_ranges(gchar* range,GPtrArray* range_ptr_arr) {
                                hfidp = g_malloc(sizeof(int));
                                *hfidp = hfi->id;
                                g_ptr_array_add(range_ptr_arr,(gpointer)hfidp);
-                               g_string_sprintfa(matecfg->fields_filter, "||%s",ranges[i]);
+                               g_string_append_printf(matecfg->fields_filter, "||%s",ranges[i]);
                        } else {
                                g_strfreev(ranges);
                                return g_strdup_printf("no such proto: '%s'",ranges[i]);;
@@ -249,7 +249,7 @@ static void analyze_pdu_hfids(gpointer k, gpointer v, gpointer p) {
        mate_cfg_pdu* cfg = p;
        new_attr_hfri(cfg->name,cfg->my_hfids,(gchar*) v);
 
-       g_string_sprintfa(matecfg->fields_filter,"||%s",my_protoname(*(int*)k));
+       g_string_append_printf(matecfg->fields_filter,"||%s",my_protoname(*(int*)k));
 }
 
 static void analyze_transform_hfrs(gchar* name, GPtrArray* transforms, GHashTable* hfids) {
index d0b9ae7d229030f73437c24f311acaff86293647..ac9ccf2569511e910a6ed67328378246adb6cafb 100644 (file)
@@ -771,7 +771,7 @@ gchar* avpl_to_str(AVPL* avpl) {
 
        for(c=avpl->null.next; c->avp; c = c->next) {
                avp_s = avp_to_str(c->avp);
-               g_string_sprintfa(s," %s;",avp_s);
+               g_string_append_printf(s," %s;",avp_s);
                g_free(avp_s);
        }
 
@@ -790,7 +790,7 @@ extern gchar* avpl_to_dotstr(AVPL* avpl) {
 
        for(c=avpl->null.next; c->avp; c = c->next) {
                avp_s = avp_to_str(c->avp);
-               g_string_sprintfa(s," .%s;",avp_s);
+               g_string_append_printf(s," .%s;",avp_s);
                g_free(avp_s);
        }