Fix warning in snprintf and g++7 and above.

This commit is contained in:
Stephen Anthony 2018-08-19 20:46:05 -02:30
parent f87e5d73f1
commit 9037af617d
1 changed files with 3 additions and 3 deletions

View File

@ -63,9 +63,9 @@ string Base::toString(int value, Common::Base::Format outputBase)
case Base::F_10: // base 10: 3 or 5 bytes (depending on value)
if(value < 0x100)
std::snprintf(vToS_buf, 4, "%3d", value);
std::snprintf(vToS_buf, 4, "%3d", value & 0xff);
else
std::snprintf(vToS_buf, 6, "%5d", value);
std::snprintf(vToS_buf, 6, "%5d", value & 0xffff);
break;
case Base::F_10_02: // base 10: 2 digits (with leading zero)