Skip to content

Commit

Permalink
revert change for str_tolower/str_toupper
Browse files Browse the repository at this point in the history
need to sstop messing around these functions
  • Loading branch information
Toni500github committed Aug 27, 2024
1 parent 31823d1 commit a016458
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions include/util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ std::string which(const std::string& command);
bool read_binary_file(std::ifstream& f, std::string& ret);
void replace_str(std::string& str, const std::string_view from, const std::string_view to);
bool read_exec(std::vector<const char*> cmd, std::string& output, bool useStdErr = false, bool noerror_print = true);
std::string str_tolower(std::string_view str);
std::string str_toupper(std::string_view str);
std::string str_tolower(std::string str);
std::string str_toupper(std::string str);
void strip(std::string& input);
std::string read_by_syspath(const std::string_view path);
fmt::rgb hexStringToColor(const std::string_view hexstr);
Expand Down
12 changes: 6 additions & 6 deletions src/util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,20 +350,20 @@ bool read_exec(std::vector<const char*> cmd, std::string& output, bool useStdErr
return false;
}

std::string str_tolower(std::string_view str)
std::string str_tolower(std::string str)
{
for (char x : str)
for (char& x : str)
x = std::tolower(x);

return str.data();
return str;
}

std::string str_toupper(std::string_view str)
std::string str_toupper(std::string str)
{
for (char x : str)
for (char& x : str)
x = std::toupper(x);

return str.data();
return str;
}

// Function to perform binary search on the pci vendors array to find a device from a vendor.
Expand Down

0 comments on commit a016458

Please sign in to comment.