parseColorsStream: fix comment stripping
p is incremented too soon to be able to see '#' on first character. Use a conventional for loop.
This commit is contained in:
parent
5558c3dd63
commit
5a174e7980
|
@ -261,15 +261,14 @@ void TileGenerator::generate(const std::string &input, const std::string &output
|
||||||
|
|
||||||
void TileGenerator::parseColorsStream(std::istream &in)
|
void TileGenerator::parseColorsStream(std::istream &in)
|
||||||
{
|
{
|
||||||
char line[128], *p;
|
char line[128];
|
||||||
while (in.good()) {
|
while (in.good()) {
|
||||||
in.getline(line, 128);
|
in.getline(line, 128);
|
||||||
p = line;
|
for (char *p = line; *p != '\0'; ++p) {
|
||||||
while(*p++ != '\0') {
|
if(*p == '#') {
|
||||||
if(*p != '#')
|
*p = '\0'; // Cut off at the first #
|
||||||
continue;
|
break;
|
||||||
*p = '\0'; // Cut off at the first #
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
char name[64];
|
char name[64];
|
||||||
|
|
Loading…
Reference in New Issue