mirror of
https://github.com/minetest/minetestmapper.git
synced 2024-11-16 07:30:28 +01:00
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)
|
||||
{
|
||||
char line[128], *p;
|
||||
char line[128];
|
||||
while (in.good()) {
|
||||
in.getline(line, 128);
|
||||
p = line;
|
||||
while(*p++ != '\0') {
|
||||
if(*p != '#')
|
||||
continue;
|
||||
*p = '\0'; // Cut off at the first #
|
||||
break;
|
||||
for (char *p = line; *p != '\0'; ++p) {
|
||||
if(*p == '#') {
|
||||
*p = '\0'; // Cut off at the first #
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
char name[64];
|
||||
|
|
Loading…
Reference in New Issue
Block a user