[Scummvm-git-logs] scummvm master -> ac1d5352be8ca43d2c8e2fdb096160172981581f
digitall
547637+digitall at users.noreply.github.com
Thu Apr 29 23:05:26 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
ac1d5352be SCUMM: Fix format-truncation warning in IMUSE player
Commit: ac1d5352be8ca43d2c8e2fdb096160172981581f
https://github.com/scummvm/scummvm/commit/ac1d5352be8ca43d2c8e2fdb096160172981581f
Author: Mathias Parnaudeau (mparnaudeau at optimum-software.fr)
Date: 2021-04-30T00:05:24+01:00
Commit Message:
SCUMM: Fix format-truncation warning in IMUSE player
The size in snprintf includes the final null character, so here
3 bytes are not enough to store a space, 2 digits and the null
character.
The compiler complained and the output used to display 1 digit
instead of 2, for each byte.
Extend this size from 3 to 4 in the snprintf call.
Changed paths:
engines/scumm/imuse/imuse_player.cpp
diff --git a/engines/scumm/imuse/imuse_player.cpp b/engines/scumm/imuse/imuse_player.cpp
index 6976d79cfc..48d35b5c27 100644
--- a/engines/scumm/imuse/imuse_player.cpp
+++ b/engines/scumm/imuse/imuse_player.cpp
@@ -408,7 +408,7 @@ void Player::sysEx(const byte *p, uint16 len) {
if (!_scanning) {
for (a = 0; a < len + 1 && a < 19; ++a) {
- snprintf((char *)&buf[a * 3], 3 * sizeof(char), " %02X", (int)p[a]);
+ snprintf((char *)&buf[a * 3], 3 * sizeof(char) + 1, " %02X", (int)p[a]);
}
if (a < len + 1) {
buf[a * 3] = buf[a * 3 + 1] = buf[a * 3 + 2] = '.';
More information about the Scummvm-git-logs
mailing list