mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Fix warnings
This commit is contained in:
parent
fe15bc03dd
commit
fd24accea7
2 changed files with 3 additions and 3 deletions
|
@ -356,7 +356,7 @@ bool lcPiecesLibrary::OpenArchive(std::unique_ptr<lcFile> File, lcZipFileType Zi
|
|||
mTextures.push_back(Texture);
|
||||
|
||||
*Dst = 0;
|
||||
strncpy(Texture->mName, Name + (ZipFileType == LC_ZIPFILE_OFFICIAL ? 21 : 15), sizeof(Texture->mName));
|
||||
strncpy(Texture->mName, Name + (ZipFileType == LC_ZIPFILE_OFFICIAL ? 21 : 15), sizeof(Texture->mName)-1);
|
||||
Texture->mName[sizeof(Texture->mName) - 1] = 0;
|
||||
}
|
||||
}
|
||||
|
@ -384,7 +384,7 @@ bool lcPiecesLibrary::OpenArchive(std::unique_ptr<lcFile> File, lcZipFileType Zi
|
|||
{
|
||||
Info = new PieceInfo();
|
||||
|
||||
strncpy(Info->mFileName, FileInfo.file_name + (Name - NameBuffer), sizeof(Info->mFileName));
|
||||
strncpy(Info->mFileName, FileInfo.file_name + (Name - NameBuffer), sizeof(Info->mFileName)-1);
|
||||
Info->mFileName[sizeof(Info->mFileName) - 1] = 0;
|
||||
|
||||
mPieces[Name] = Info;
|
||||
|
|
|
@ -37,7 +37,7 @@ public:
|
|||
explicit lcLibraryPrimitive(QString&& FileName, const char* Name, lcZipFileType ZipFileType, quint32 ZipFileIndex, bool Stud, bool SubFile)
|
||||
: mFileName(std::move(FileName))
|
||||
{
|
||||
strncpy(mName, Name, sizeof(mName));
|
||||
strncpy(mName, Name, sizeof(mName)-1);
|
||||
mName[sizeof(mName) - 1] = 0;
|
||||
|
||||
mZipFileType = ZipFileType;
|
||||
|
|
Loading…
Reference in a new issue