IRIX/MipsPro 7.2 doesn't have strndup. Work around it.
This commit is contained in:
parent
8b2cfb515b
commit
06ce7ae928
1 changed files with 3 additions and 1 deletions
|
@ -18,7 +18,9 @@ AirportList::AirportList (int x, int y, int width, int height)
|
|||
snprintf(buf, 1023, "%s %s\n",
|
||||
airport->id.c_str(),
|
||||
airport->name.c_str());
|
||||
_content[i] = strndup(buf, 1023);
|
||||
int str_len = strlen(buf);
|
||||
_content[i] = new char[(str_len > 1023) ? 1024 : str_len];
|
||||
strncpy(_content[i], buf, 1023);
|
||||
}
|
||||
_content[_nAirports] = 0;
|
||||
newList(_content);
|
||||
|
|
Loading…
Add table
Reference in a new issue