diff --git a/samples/geotag.cpp b/samples/geotag.cpp
index 9c6581ff..7ad726fe 100644
--- a/samples/geotag.cpp
+++ b/samples/geotag.cpp
@@ -420,13 +420,6 @@ std::string makePath(const std::string& dir, const std::string& file) {
return dir + std::string(EXV_SEPARATOR_STR) + file;
}
-const char* makePath(const char* dir, const char* file) {
- static char result[_MAX_PATH];
- std::string r = makePath(std::string(dir), std::string(file));
- strcpy(result, r.c_str());
- return result;
-}
-
// file utilities
bool readDir(const char* path, Options& options) {
bool bResult = false;
@@ -452,7 +445,7 @@ bool readDir(const char* path, Options& options) {
if (ffd.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
// _tprintf(TEXT(" %s
\n"), ffd.cFileName);
} else {
- std::string pathName = makePath(path, std::string(ffd.cFileName));
+ std::string pathName = makePath(path, ffd.cFileName);
if (getFileType(pathName, options) == typeImage) {
gFiles.push_back(pathName);
}
diff --git a/src/basicio.cpp b/src/basicio.cpp
index e3532a0f..dcd64ca1 100644
--- a/src/basicio.cpp
+++ b/src/basicio.cpp
@@ -167,10 +167,7 @@ int FileIo::Impl::switchMode(OpMode opMode) {
if (offset == -1)
return -1;
// 'Manual' open("r+b") to avoid munmap()
- if (fp_) {
- std::fclose(fp_);
- fp_ = nullptr;
- }
+ std::fclose(fp_);
openMode_ = "r+b";
opMode_ = opSeek;
fp_ = std::fopen(path_.c_str(), openMode_.c_str());
diff --git a/src/image.cpp b/src/image.cpp
index bfe1e1a5..358da7e8 100644
--- a/src/image.cpp
+++ b/src/image.cpp
@@ -786,7 +786,7 @@ ImageType ImageFactory::getType(BasicIo& io) {
return ImageType::none;
}
-BasicIo::UniquePtr ImageFactory::createIo(const std::string& path, bool useCurl) {
+BasicIo::UniquePtr ImageFactory::createIo(const std::string& path, [[maybe_unused]] bool useCurl) {
Protocol fProt = fileProtocol(path);
#ifdef EXV_USE_CURL
@@ -803,8 +803,6 @@ BasicIo::UniquePtr ImageFactory::createIo(const std::string& path, bool useCurl)
return std::make_unique(path); // may throw
return std::make_unique(path);
-
- (void)(useCurl);
} // ImageFactory::createIo
Image::UniquePtr ImageFactory::open(const std::string& path, bool useCurl) {
diff --git a/src/value.cpp b/src/value.cpp
index 24f2786e..6b8d1d75 100644
--- a/src/value.cpp
+++ b/src/value.cpp
@@ -371,7 +371,7 @@ std::string CommentValue::comment(const char* encoding) const {
if (charsetId() == unicode) {
const char* from = !encoding || *encoding == '\0' ? detectCharset(c) : encoding;
if (!convertStringCharset(c, from, "UTF-8"))
- throw Error(ErrorCode::kerInvalidIconvEncoding, encoding, "UTF-8");
+ throw Error(ErrorCode::kerInvalidIconvEncoding, from, "UTF-8");
}
// # 1266 Remove trailing nulls
diff --git a/src/xmp.cpp b/src/xmp.cpp
index a517f78e..5130ca6c 100644
--- a/src/xmp.cpp
+++ b/src/xmp.cpp
@@ -693,7 +693,6 @@ int XmpParser::decode(XmpData& xmpData, const std::string& xmpPacket) {
printNode(schemaNs, propPath, propValue, opt);
if (XMP_PropIsAlias(opt)) {
throw Error(ErrorCode::kerAliasesNotSupported, schemaNs, propPath, propValue);
- continue;
}
if (XMP_NodeIsSchema(opt)) {
// Register unknown namespaces with Exiv2