Fix (unlikely) truncation in write_xbm_image()

The usual qsizetype -> int problem. Fix by using auto.

Pick-to: 6.8
Change-Id: Ie990dec39c8c33cdc055da6bfee451319825c934
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
This commit is contained in:
Marc Mutz 2024-07-18 14:44:49 +02:00
parent f7d1d5cb01
commit 0cef4ae687

View File

@ -162,7 +162,7 @@ static bool write_xbm_image(const QImage &sourceImage, QIODevice *device, const
int h = image.height();
int i;
const QByteArray s = fileName.toUtf8(); // get file base name
int msize = s.size() + 100;
const auto msize = s.size() + 100;
char *buf = new char[msize];
qsnprintf(buf, msize, "#define %s_width %d\n", s.data(), w);