Refactor is_positive_num() to use C-strings

This makes the future move to C easier, as well as just shows that it's
plain unnecessary to use an std::string here.
This commit is contained in:
Misa
2021-02-11 16:36:22 -08:00
committed by Ethan Lee
parent 825dbac228
commit 89bddf98b6
3 changed files with 4 additions and 4 deletions

View File

@@ -284,9 +284,9 @@ static bool VVV_isxdigit(const unsigned char digit)
|| SDL_isdigit(digit);
}
bool is_positive_num(const std::string& str, const bool hex)
bool is_positive_num(const char* str, const bool hex)
{
for (size_t i = 0; i < str.length(); i++)
for (size_t i = 0; str[i] != '\0'; ++i)
{
if (hex)
{