Commit Graph

4 Commits

Author SHA1 Message Date
Frank Praznik
f3d39815e7 progressbar: Ensure buffers are large enough for string manipulation 2025-11-09 16:59:35 -05:00
Simon McVittie
c13e74be6b progress: Correct calls to dbus_message_iter_open_container with variants
As documented, the contained_signature is to be passed in as a
nul-terminated C string.

For basic types that are represented by a single character, on
little-endian platforms, putting the type in the least significant
byte of an int and casting its address to `char *` happens to result in
a valid string, because the int's in-memory representation looks like
`(char []){ 'b', 0, 0, 0 }`. However, on big-endian platforms, the int's
in-memory representation is `(char []){ 0, 0, 0, 'b' }` which is not
a valid type for a D-Bus variant to hold (it is interpreted as an empty
string, and variants are not allowed to be empty).

Instead, do this the straightforward way, with a mnemonic string and
no casts (in the same style used in `SDL_portaldialog`).

Fixes: 3f2226a9 "Add progress bar support for Linux"
Resolves: https://github.com/libsdl-org/SDL/issues/13953
Bug-Debian: https://bugs.debian.org/1115705
Signed-off-by: Simon McVittie <smcv@collabora.com>
2025-09-23 08:19:25 -07:00
Petar Popovic
2c2c2c5a48 Fixed a few "-Wstrict-prototypes" warnings 2025-07-26 11:12:40 -07:00
GamesTrap
3f2226a917 Add progress bar support for Linux 2025-05-10 07:53:36 -07:00