summaryrefslogtreecommitdiff
path: root/lib/utils/mu-utils-file.cc
diff options
context:
space:
mode:
authorDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-10 00:12:50 +0300
committerDirk-Jan C. Binnema <djcb@djcbsoftware.nl>2026-04-17 23:45:49 +0300
commit9c34ecf4a52379520d30b024c199f5ca6c5b38af (patch)
treeca01e66f98ee90a30ebf0adef1facdad617bae79 /lib/utils/mu-utils-file.cc
parent08ed7d2a8cd0a250cba7d0d918a7ebeaf778fc10 (diff)
lib/utils: small cleanupsrelease/1.12
Fix some static analysis warnings
Diffstat (limited to 'lib/utils/mu-utils-file.cc')
-rw-r--r--lib/utils/mu-utils-file.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/utils/mu-utils-file.cc b/lib/utils/mu-utils-file.cc
index 56b1c6f..d1cb85b 100644
--- a/lib/utils/mu-utils-file.cc
+++ b/lib/utils/mu-utils-file.cc
@@ -87,9 +87,10 @@ Mu::canonicalize_filename(const std::string& path, const std::string& relative_t
path.c_str(),
relative_to.empty() ? nullptr : relative_to.c_str())).value()};
- // remove trailing '/'... is this needed?
- if (str[str.length()-1] == G_DIR_SEPARATOR)
- str.erase(str.length() - 1);
+ if (!str.empty()) { // remove trailing '/'... is this needed?
+ if (str[str.length()-1] == G_DIR_SEPARATOR)
+ str.erase(str.length() - 1);
+ }
return str;
}
@@ -232,7 +233,6 @@ Mu::read_from_stdin()
{
g_autoptr(GOutputStream) outmem = g_memory_output_stream_new_resizable();
g_autoptr(GInputStream) input = g_unix_input_stream_new(STDIN_FILENO, TRUE);
- //g_autoptr(GCancellable) cancel{maybe_cancellable_timeout(timeout)};
GError *err{};
auto bytes = g_output_stream_splice(outmem, input,