diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2020-12-08 22:42:46 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2020-12-08 23:55:32 +0100 |
commit | e4dc69b2b97dbd56bd55e514a5abcbd3c2a2f2fb (patch) | |
tree | fe77e335eafd0f28d73941e86430078b0905ffb0 /vcl | |
parent | 44c2689bbd80abc3d6b3ce5b148d157bb71730fa (diff) |
Remove redundant strlen call
068f244222edcc5916fe864a0265ab6ccb4e43d2 "gtk3_kde5: port away from
boost::process" had introduced this as
return OUString::fromUtf8(OString(ret.c_str(), ret.size()));
(so would have preserved embedded NUL characters in ret, even if such should not
exist in a pathname anyway and this form was likely not chosen over the shorter
return OUString::fromUtf8(OString(ret.c_str()));
with the intention of preserving embedded NULs).
Then ec3aee0ef36f1ec3848581009b0de01e0ffd5e8f "Fix build with older versions of
Boost" replaced that with
return OUString::fromUtf8(OString(ret.c_str(), strlen(ret.c_str())));
which has the exact opposite effect of cutting at the first embedded NUL (which,
again, was likely not the motivation for choosing this form).
Change-Id: Ic2d432907bce38a0314a0556a9540d08cdc42929
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107443
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx index 80c15938bdaf..e9c9f4621820 100644 --- a/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx +++ b/vcl/unx/gtk3_kde5/gtk3_kde5_filepicker_ipc.cxx @@ -53,7 +53,7 @@ OUString applicationDirPath() const auto utf8Path = applicationSystemPath.toUtf8(); auto ret = boost::filesystem::path(utf8Path.getStr(), utf8Path.getStr() + utf8Path.getLength()); ret.remove_filename(); - return OUString::fromUtf8(OString(ret.c_str(), strlen(ret.c_str()))); + return OUString::fromUtf8(OString(ret.c_str())); } OUString findPickerExecutable() |