diff --git a/common/lc_global.h b/common/lc_global.h index e3b373ac..5bf4d927 100644 --- a/common/lc_global.h +++ b/common/lc_global.h @@ -30,14 +30,10 @@ typedef quint64 lcuint64; typedef quintptr lcuintptr; #ifdef Q_OS_WIN -#define snprintf _snprintf -#define strcasecmp stricmp -#define strncasecmp strnicmp char* strcasestr(const char *s, const char *find); #else char* strupr(char* string); char* strlwr(char* string); -int stricmp(const char* str1, const char* str2); #endif // Version number. diff --git a/common/lc_model.cpp b/common/lc_model.cpp index f7b3c88d..c616ed87 100644 --- a/common/lc_model.cpp +++ b/common/lc_model.cpp @@ -753,10 +753,11 @@ bool lcModel::LoadBinary(lcFile* file) file->Seek(sh, SEEK_CUR); else { - String Author; - file->ReadBuffer(Author.GetBuffer(sh), sh); - Author.Buffer()[sh] = 0; - mProperties.mAuthor = QString::fromUtf8(Author.Buffer()); + QByteArray Author; + Author.resize(sh + 1); + file->ReadBuffer(Author.data(), sh); + Author[sh] = 0; + mProperties.mAuthor = QString::fromUtf8(Author); } file->ReadBuffer(&ch, 1); @@ -765,10 +766,11 @@ bool lcModel::LoadBinary(lcFile* file) file->Seek(sh, SEEK_CUR); else { - String Description; - file->ReadBuffer(Description.GetBuffer(sh), sh); - Description.Buffer()[sh] = 0; - mProperties.mDescription = QString::fromUtf8(Description.Buffer()); + QByteArray Description; + Description.resize(sh + 1); + file->ReadBuffer(Description.data(), sh); + Description[sh] = 0; + mProperties.mDescription = QString::fromUtf8(Description); } file->ReadBuffer(&ch, 1); @@ -777,10 +779,11 @@ bool lcModel::LoadBinary(lcFile* file) file->Seek(sh, SEEK_CUR); else { - String Comments; - file->ReadBuffer(Comments.GetBuffer(sh), sh); - Comments.Buffer()[sh] = 0; - mProperties.mComments = QString::fromUtf8(Comments.Buffer()); + QByteArray Comments; + Comments.resize(sh + 1); + file->ReadBuffer(Comments.data(), sh); + Comments[sh] = 0; + mProperties.mComments = QString::fromUtf8(Comments); mProperties.mComments.replace(QLatin1String("\r\n"), QLatin1String("\n")); } } diff --git a/common/lc_zipfile.cpp b/common/lc_zipfile.cpp index fbbb12de..7fd4c420 100644 --- a/common/lc_zipfile.cpp +++ b/common/lc_zipfile.cpp @@ -595,7 +595,7 @@ bool lcZipFile::ExtractFile(const char* FileName, lcMemFile& File, lcuint32 MaxL { lcZipFileInfo& FileInfo = mFiles[FileIdx]; - if (!stricmp(FileInfo.file_name, FileName)) + if (!qstricmp(FileInfo.file_name, FileName)) return ExtractFile(FileIdx, File, MaxLength); } diff --git a/qt/system.cpp b/qt/system.cpp index 99ff233f..ebaab800 100644 --- a/qt/system.cpp +++ b/qt/system.cpp @@ -19,7 +19,7 @@ char* strcasestr(const char *s, const char *find) if ((sc = *s++) == 0) return (NULL); } while ((char)tolower((unsigned char)sc) != c); - } while (strncasecmp(s, find, len) != 0); + } while (qstrnicmp(s, find, len) != 0); s--; } return ((char *)s); @@ -43,9 +43,4 @@ char* strlwr(char *string) return string; } -int stricmp(const char *str1, const char *str2) -{ - return strcasecmp(str1, str2); -} - #endif