mirror of
https://github.com/minetest/minetestmapper.git
synced 2025-07-05 01:50:21 +02: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:
@ -261,16 +261,15 @@ 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 != '#')
|
|
||||||
continue;
|
|
||||||
*p = '\0'; // Cut off at the first #
|
*p = '\0'; // Cut off at the first #
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
char name[64];
|
char name[64];
|
||||||
unsigned int r, g, b, a, t;
|
unsigned int r, g, b, a, t;
|
||||||
|
Reference in New Issue
Block a user