g_snprintf and g_vsnprintf should take a gsize as the buffer length
Submitted by Guy Harris
Link to original bug (#592155)
Description
snprintf() and vsprintf() take a size_t; g_snprintf() and g_vsnprintf() take a gulong. On most platforms gulong and gsize are the same type; however, on Win64, gulong is a 32-bit unsigned integer while gsize is a 64-bit unsigned integer.
This means that some compilers emit warnings if, for example, the result of a sizeof operator is used as the size argument to g_snprintf() or g_vsnprintf(); Wireshark has a bunch of casts to deal with those warnings.
A similar problem with g_malloc() was fixed over a year ago:
http://git.gnome.org/cgit/glib/commit/?id=1fcaf2fe8d5118451e5d9da3347f711b623d504d
Now, at this point, there might be a Win64 ABI for GLib, in which case we're screwed; otherwise, I'd suggest changing those APIs.
Version: 2.21.x