Docs: Fix a README.developer code example

Remove spurious "int".

Also prefer "g_string_printf", just for stylistic reasons.
João Valverde 2021-12-18 20:08:27 +00:00 committed by Wireshark GitLab Utility
parent 64c0e166d1
commit 2f572659f5
1 changed files with 3 additions and 3 deletions

View File

@ -128,7 +128,7 @@ these headers; they are included in <wireshark.h>. Use that instead.
To print fixed width integers you must use the macros provided in <inttypes.h>.
int uint32_t var;
uint32_t var;
printf("var = " PRIu32 "\n", var);
Don't use "long" to mean "signed 32-bit integer", and don't use
@ -205,8 +205,8 @@ For GLib routines, and only those, you can choose whichever format style
you prefer:
uint64_t val = UINT64_C(1);
char *str1 = g_strdup_printf("%" G_GUINT64_FORMAT, val);
char *str2 = g_strdup_printf("%" PRIu64, val);
char *str1 = g_string_printf("%" G_GUINT64_FORMAT, val);
char *str2 = g_string_printf("%" PRIu64, val);
These format macros will be the same modulo any GLib bugs.