From 3bb0caafc4473bf277dfbc65c4b9c9db65bf84be Mon Sep 17 00:00:00 2001 From: "C.W. Betts" Date: Thu, 9 May 2024 21:02:44 -0600 Subject: [PATCH] Quiet/fix a couple of static analyzer warnings as reported by Xcode. --- bitmap/bitmain.cpp | 2 +- ddio_lnx/lnxfile.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bitmap/bitmain.cpp b/bitmap/bitmain.cpp index 5ad52828..a1c6d873 100644 --- a/bitmap/bitmain.cpp +++ b/bitmap/bitmain.cpp @@ -661,7 +661,7 @@ void bm_ChangeEndName(const char *src, char *dest) { ddio_SplitPath(src, path, filename, ext); limit = BITMAP_NAME_LEN - 7; // Make sure we don't go over our name length limit - strncpy(filename, filename, limit); +// strncpy(filename, filename, limit); filename[limit] = 0; Start: if (curnum != -1) diff --git a/ddio_lnx/lnxfile.cpp b/ddio_lnx/lnxfile.cpp index eeda8b5c..83f66ea6 100644 --- a/ddio_lnx/lnxfile.cpp +++ b/ddio_lnx/lnxfile.cpp @@ -262,7 +262,7 @@ void ddio_MakePath(char *newPath, const char *absolutePathHeader, const char *su // Add the first sub directory pathLength = strlen(newPath); - if (newPath[pathLength - 1] != delimiter) { + if (pathLength > 0 && newPath[pathLength - 1] != delimiter) { newPath[pathLength] = delimiter; // add the delimiter newPath[pathLength + 1] = 0; // terminate the string }