Fix several compiler warnings

* -Wmaybe-uninitialized
* -Wunused-parameter
* -Wunused-variable
* -Wnonnull
* -Wstringop-truncation
* -Wstringop-overflow
This commit is contained in:
wmayer
2024-06-18 23:21:53 +02:00
committed by Chris Hennes
parent 951ece6b4c
commit 127f935711
16 changed files with 32 additions and 19 deletions

View File

@@ -927,7 +927,7 @@ char* System::Strcpy (char* acDst, size_t uiDstSize, const char* acSrc)
// copy failed.
return nullptr;
}
strncpy(acDst,acSrc,uiSrcLen);
strncpy(acDst,acSrc,uiSrcLen + 1);
acDst[uiSrcLen] = 0;
return acDst;
#endif
@@ -962,7 +962,7 @@ char* System::Strcat (char* acDst, size_t uiDstSize, const char* acSrc)
// the concatenation failed.
return nullptr;
}
strncat(acDst,acSrc,uiSrcLen);
strncat(acDst,acSrc,uiSrcLen + 1);
acDst[uiSumLen] = 0;
return acDst;
#endif