diff options
author | B. Stack <bgstack15@gmail.com> | 2022-10-11 11:16:39 -0400 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-10-11 11:16:39 -0400 |
commit | cab22f2dc3c5f41b5163f74cbb233e390edff6ff (patch) | |
tree | a49cfd729d9793681a57fa6f7409b0f0848e9ede /zen/sys_info.cpp | |
parent | Merge branch 'b11.25' into 'master' (diff) | |
download | FreeFileSync-cab22f2dc3c5f41b5163f74cbb233e390edff6ff.tar.gz FreeFileSync-cab22f2dc3c5f41b5163f74cbb233e390edff6ff.tar.bz2 FreeFileSync-cab22f2dc3c5f41b5163f74cbb233e390edff6ff.zip |
add upstream 11.26
Diffstat (limited to 'zen/sys_info.cpp')
-rw-r--r-- | zen/sys_info.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/zen/sys_info.cpp b/zen/sys_info.cpp index c57464bc..87e07f91 100644 --- a/zen/sys_info.cpp +++ b/zen/sys_info.cpp @@ -43,7 +43,7 @@ Zstring zen::getLoginUser() //throw FileError passwd* pwEntry = nullptr; if (const int rv = ::getpwuid_r(userIdNo, //uid_t uid &buf2, //struct passwd* pwd - &buf[0], //char* buf + buf.data(), //char* buf buf.size(), //size_t buflen &pwEntry); //struct passwd** result rv != 0 || !pwEntry) @@ -82,10 +82,10 @@ Zstring zen::getUserDescription() //throw FileError const Zstring computerName = []() -> Zstring //throw FileError { std::vector<char> buf(10000); - if (::gethostname(&buf[0], buf.size()) != 0) + if (::gethostname(buf.data(), buf.size()) != 0) THROW_LAST_FILE_ERROR(_("Cannot get process information."), "gethostname"); - Zstring hostName = &buf[0]; + Zstring hostName = buf.data(); if (endsWithAsciiNoCase(hostName, ".local")) //strip fluff (macOS) => apparently not added on Linux? hostName = beforeLast(hostName, '.', IfNotFoundReturn::none); @@ -204,7 +204,7 @@ Zstring zen::getUserHome() //throw FileError passwd* pwEntry = nullptr; if (const int rv = ::getpwnam_r(loginUser.c_str(), //const char *name &buf2, //struct passwd* pwd - &buf[0], //char* buf + buf.data(), //char* buf buf.size(), //size_t buflen &pwEntry); //struct passwd** result rv != 0 || !pwEntry) |