mirror of
https://github.com/badaix/snapcast.git
synced 2025-05-25 15:06:21 +02:00
Fix static analysis issues
This commit is contained in:
parent
03ce0ed2df
commit
17efc6799c
22 changed files with 56 additions and 62 deletions
|
@ -33,7 +33,6 @@
|
|||
#endif
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
|
@ -64,7 +63,7 @@ static void do_chown(const std::string& file_path, const std::string& user_name,
|
|||
|
||||
if (!user_name.empty())
|
||||
{
|
||||
struct passwd* pwd = getpwnam(user_name.c_str());
|
||||
const struct passwd* pwd = getpwnam(user_name.c_str());
|
||||
if (pwd == nullptr)
|
||||
throw std::runtime_error("Failed to get uid");
|
||||
uid = pwd->pw_uid;
|
||||
|
@ -72,7 +71,7 @@ static void do_chown(const std::string& file_path, const std::string& user_name,
|
|||
|
||||
if (!group_name.empty())
|
||||
{
|
||||
struct group* grp = getgrnam(group_name.c_str());
|
||||
const struct group* grp = getgrnam(group_name.c_str());
|
||||
if (grp == nullptr)
|
||||
throw std::runtime_error("Failed to get gid");
|
||||
gid = grp->gr_gid;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue