File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -499,7 +499,7 @@ int main(int argc, char* argv[]) {
499499 int probIdx = itemIdx + 1 ;
500500
501501 if (itemIdx >= 0 && probIdx < tokens.size () && tokens[itemIdx][0 ] != ' \0 ' && tokens[probIdx][0 ] != ' \0 ' ) {
502- tc.items [i].name = tokens[itemIdx];
502+ tc.items [i].name = trim ( tokens[itemIdx]) ;
503503 tc.items [i].prob = atoi (tokens[probIdx].c_str ());
504504 tc.total += tc.items [i].prob ;
505505 }
@@ -575,7 +575,7 @@ int main(int argc, char* argv[]) {
575575 atomic[tcBaseName] = atc;
576576
577577 for (long i = 1 ; i < tokens.size () - 1 ; i += 2 ) {
578- std::string itemName = tokens[i];
578+ std::string itemName = trim ( tokens[i]) ;
579579 int itemProb = atoi (tokens[i + 1 ].c_str ());
580580
581581 atomic[tcBaseName].items .push_back ({ itemName, itemProb });
Original file line number Diff line number Diff line change @@ -584,7 +584,7 @@ int main(int argc, char* argv[]) {
584584 if (argc >= 4 ) {
585585 finditem = atoi (argv[3 ]);
586586 }
587-
587+
588588 if (argc >= 5 ) {
589589 difficulty = atoi (argv[4 ]);
590590 }
@@ -655,7 +655,7 @@ int main(int argc, char* argv[]) {
655655 int probIdx = itemIdx + 1 ;
656656
657657 if (itemIdx >= 0 && probIdx < tokens.size () && tokens[itemIdx][0 ] != ' \0 ' && tokens[probIdx][0 ] != ' \0 ' ) {
658- tc.items [i].name = tokens[itemIdx];
658+ tc.items [i].name = trim ( tokens[itemIdx]) ;
659659 tc.items [i].prob = atoi (tokens[probIdx].c_str ());
660660 tc.total += tc.items [i].prob ;
661661 }
@@ -731,7 +731,7 @@ int main(int argc, char* argv[]) {
731731 atomic[tcBaseName] = atc;
732732
733733 for (long i = 1 ; i < tokens.size () - 1 ; i += 2 ) {
734- std::string itemName = tokens[i];
734+ std::string itemName = trim ( tokens[i]) ;
735735 int itemProb = atoi (tokens[i + 1 ].c_str ());
736736
737737 atomic[tcBaseName].items .push_back ({ itemName, itemProb });
You can’t perform that action at this time.
0 commit comments