diff --git a/src/imageformats/kra.cpp b/src/imageformats/kra.cpp index 368a836..9945d08 100644 --- a/src/imageformats/kra.cpp +++ b/src/imageformats/kra.cpp @@ -18,6 +18,9 @@ #include #include +static constexpr char s_magic[] = "application/x-krita"; +static constexpr int s_magic_size = strlen(s_magic); + KraHandler::KraHandler() { } @@ -55,7 +58,7 @@ bool KraHandler::canRead(QIODevice *device) char buff[57]; if (device->peek(buff, sizeof(buff)) == sizeof(buff)) - return qstrcmp(buff + 0x26, "application/x-krita") == 0; + return memcmp(buff + 0x26, s_magic, s_magic_size) == 0; return false; } diff --git a/src/imageformats/ora.cpp b/src/imageformats/ora.cpp index bc5558f..792181f 100644 --- a/src/imageformats/ora.cpp +++ b/src/imageformats/ora.cpp @@ -17,6 +17,9 @@ #include +static constexpr char s_magic[] = "image/openraster"; +static constexpr int s_magic_size = strlen(s_magic); + OraHandler::OraHandler() { } @@ -54,7 +57,7 @@ bool OraHandler::canRead(QIODevice *device) char buff[54]; if (device->peek(buff, sizeof(buff)) == sizeof(buff)) - return qstrcmp(buff + 0x26, "image/openraster") == 0; + return memcmp(buff + 0x26, s_magic, s_magic_size) == 0; return false; }