From: Mikko Rasa Date: Wed, 20 Jun 2018 10:30:35 +0000 (+0300) Subject: Fix sizeof(jpeg_sig) X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=eacf9fc4ab7a95d08414c0d94a46925dd1a987bd;p=libs%2Fgui.git Fix sizeof(jpeg_sig) Initializing a char array with a string literal appends a nul byte at the end, which is not something we want. --- diff --git a/source/graphics/jpeg/jpegloader.cpp b/source/graphics/jpeg/jpegloader.cpp index 39866c1..b580156 100644 --- a/source/graphics/jpeg/jpegloader.cpp +++ b/source/graphics/jpeg/jpegloader.cpp @@ -113,10 +113,10 @@ JpegLoader::~JpegLoader() bool JpegLoader::detect(const string &sig) { - static const char jpeg_sig[] = "\xFF\xD8\xFF"; + static const char jpeg_sig[] = { '\xFF', '\xD8', '\xFF' }; if(sig.size()