Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/c-api/c_functional.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "c_functional.hpp"
#include "c_status.hpp"

#ifdef EXCHCXX_ENABLE_LIBXC
namespace GauXC::detail {
/**
* Splits a string into tokens based on a delimiter
Expand All @@ -28,7 +29,7 @@ namespace GauXC::detail {
* \param [in] str std::string to split
* \param [in] delimiters Delimiters on which to split str
*/
static inline void split(std::vector<std::string>& tokens,
static inline void split(std::vector<std::string>& tokens,
const std::string& str, const std::string& delimiters = " ") {

tokens.clear();
Expand All @@ -47,6 +48,7 @@ static inline void split(std::vector<std::string>& tokens,
}
}; // split
} // namespace GauXC::detail
#endif

namespace GauXC::C {
extern "C" {
Expand Down
5 changes: 3 additions & 2 deletions src/c-api/c_status.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,9 @@ static inline void gauxc_status_handle(C::GauXCStatus* status, int code, const c
if (status->message != nullptr) {
std::free(status->message);
}
status->message = (char*)std::malloc(std::strlen(message) + 1);
std::strcpy(status->message, message);
const std::size_t len = std::strlen(message) + 1;
status->message = (char*)std::malloc(len);
std::memcpy(status->message, message, len);
} else {
GAUXC_GENERIC_EXCEPTION(message);
}
Expand Down
3 changes: 2 additions & 1 deletion src/c-api/c_xc_integrator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ GauXCIntegrator gauxc_integrator_new(

// Create Integrator instance
auto input_type_ = std::string(integrator_input_type);
std::transform( input_type_.begin(), input_type_.end(), input_type_.begin(), ::toupper );
std::transform( input_type_.begin(), input_type_.end(), input_type_.begin(),
[](unsigned char c) { return static_cast<char>(std::toupper(c)); } );

if( input_type_ != "REPLICATED" ) GAUXC_GENERIC_EXCEPTION("INTEGRATOR TYPE NOT RECOGNIZED");

Expand Down
Loading