Skip to content

Commit 08ec239

Browse files
authored
[repair] Stop using C string methods and use C++ ones instead.
1 parent f40635d commit 08ec239

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

gb/commands/repair.cc

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ module;
77
import gblib;
88
import std;
99

10-
#include <ctype.h>
11-
#include <strings.h>
12-
1310
module commands;
1411

1512
namespace GB::commands {
@@ -25,7 +22,7 @@ void repair(const command_t& argv, GameObj& g) {
2522
where = std::make_unique<Place>(g.level(), g.snum(), g.pnum());
2623
} else {
2724
/* repairing a sector */
28-
if (isdigit(argv[1][0]) && index(argv[1].c_str(), ',') != nullptr) {
25+
if (std::isdigit(argv[1][0]) && argv[1].find(',') != std::string::npos) {
2926
if (g.level() != ScopeLevel::LEVEL_PLAN) {
3027
g.out << "There are no sectors here.\n";
3128
return;
@@ -60,7 +57,7 @@ void repair(const command_t& argv, GameObj& g) {
6057
return;
6158
}
6259
auto& smap = *smap_handle;
63-
if (isdigit(argv[1][0]) && index(argv[1].c_str(), ',') != nullptr) {
60+
if (std::isdigit(argv[1][0]) && argv[1].find(',') != std::string::npos) {
6461
// translate from lowx:hix,lowy:hiy
6562
auto coords = get4args(argv[1]);
6663
if (!coords) {

0 commit comments

Comments
 (0)