diff options
author | João Valverde <j@v6e.pt> | 2021-12-16 18:06:18 +0000 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-12-19 19:29:53 +0000 |
commit | c5a19582e4e18605e8528cd999221444f7ece318 (patch) | |
tree | d4206130200f56796a10eb2178ba8cefda1e7087 /epan/dtd_preparse.l | |
parent | 737d1dc125cc82851dee26004f9dc7922ed27c03 (diff) |
epan: Convert to use stdio.h from GLib
Replace:
g_snprintf() -> snprintf()
g_vsnprintf() -> vsnprintf()
g_strdup_printf() -> ws_strdup_printf()
g_strdup_vprintf() -> ws_strdup_vprintf()
This is more portable, user-friendly and faster on platforms
where GLib does not like the native I/O.
Adjust the format string to use macros from intypes.h.
Diffstat (limited to 'epan/dtd_preparse.l')
-rw-r--r-- | epan/dtd_preparse.l | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/epan/dtd_preparse.l b/epan/dtd_preparse.l index 93f755941d..5a01c6977a 100644 --- a/epan/dtd_preparse.l +++ b/epan/dtd_preparse.l @@ -196,7 +196,7 @@ newline \n <OUTSIDE>{entity_start} { BEGIN IN_ENTITY; } -<IN_ENTITY>{name} { yyextra->entity_name = g_strdup_printf("%%%s;",yytext); BEGIN NAMED_ENTITY; } +<IN_ENTITY>{name} { yyextra->entity_name = ws_strdup_printf("%%%s;",yytext); BEGIN NAMED_ENTITY; } <NAMED_ENTITY>{quote} { yyextra->current = g_string_new(dtd_location(yyextra)); BEGIN IN_QUOTE; } <IN_QUOTE>{quote} { g_hash_table_insert(yyextra->entities,yyextra->entity_name,yyextra->current); BEGIN ENTITY_DONE; } <IN_QUOTE>{percent} | @@ -238,7 +238,7 @@ const gchar* dtd_location(Dtd_PreParse_scanner_state_t* state) { if (!state) return NULL; - loc = g_strdup_printf("<? wireshark:location %s:%u ?>", state->filename, state->linenum); + loc = ws_strdup_printf("<? wireshark:location %s:%u ?>", state->filename, state->linenum); return loc; } @@ -250,7 +250,7 @@ static gboolean free_gstring_hash_items(gpointer k,gpointer v,gpointer p _U_) { } extern GString* dtd_preparse(const gchar* dname,const gchar* fname, GString* err) { - gchar* fullname = g_strdup_printf("%s%c%s",dname,G_DIR_SEPARATOR,fname); + gchar* fullname = ws_strdup_printf("%s%c%s",dname,G_DIR_SEPARATOR,fname); FILE *in; yyscan_t scanner; Dtd_PreParse_scanner_state_t state; |