J :
* Replace index() with strchr(), which is the same but also exists in windows.
This commit is contained in:
@@ -1,3 +1,4 @@
|
|||||||
|
#include <string.h>
|
||||||
#include "../include/config.h"
|
#include "../include/config.h"
|
||||||
#include "../include/MTGDeck.h"
|
#include "../include/MTGDeck.h"
|
||||||
#include "../include/utils.h"
|
#include "../include/utils.h"
|
||||||
@@ -146,7 +147,7 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
|||||||
case 's': //subtype
|
case 's': //subtype
|
||||||
if(!primitive) primitive = NEW CardPrimitive();
|
if(!primitive) primitive = NEW CardPrimitive();
|
||||||
while (true){
|
while (true){
|
||||||
char* found = index(val, ' ');
|
char* found = strchr(val, ' ');
|
||||||
if (found) {
|
if (found) {
|
||||||
string value(val, found - val);
|
string value(val, found - val);
|
||||||
primitive->setSubtype(value);
|
primitive->setSubtype(value);
|
||||||
@@ -169,7 +170,7 @@ int MTGAllCards::processConfLine(string &s, MTGCard *card, CardPrimitive * primi
|
|||||||
primitive->setText(val);
|
primitive->setText(val);
|
||||||
else if (0 == strcmp("type", key)) {
|
else if (0 == strcmp("type", key)) {
|
||||||
while (true){
|
while (true){
|
||||||
char* found = index(val, ' ');
|
char* found = strchr(val, ' ');
|
||||||
if (found) {
|
if (found) {
|
||||||
string value(val, found - val);
|
string value(val, found - val);
|
||||||
primitive->setType(value);
|
primitive->setType(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user