diff options
author | João Valverde <j@v6e.pt> | 2021-12-18 20:08:27 +0000 |
---|---|---|
committer | Wireshark GitLab Utility <gerald+gitlab-utility@wireshark.org> | 2021-12-18 21:13:20 +0000 |
commit | 2f572659f5d86907a3b657ebc3c90f4f6f7f11e8 (patch) | |
tree | b6ceb79798354b0eb3cb78986561029bdd87dada /doc/README.developer | |
parent | 64c0e166d15c3cf22d3814cbe09180ef79869f3f (diff) |
Docs: Fix a README.developer code example
Remove spurious "int".
Also prefer "g_string_printf", just for stylistic reasons.
Diffstat (limited to 'doc/README.developer')
-rw-r--r-- | doc/README.developer | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/README.developer b/doc/README.developer index c022ae0dc3..f24590c4bb 100644 --- a/doc/README.developer +++ b/doc/README.developer @@ -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. |