- char buf[1024];
-
- _airports = globals->get_airports();
- _nAirports = _airports->size();
-
- _content = new char *[_nAirports+1];
- for (int i = 0; i < _nAirports; i++) {
- const FGAirport * airport = _airports->getAirport(i);
- snprintf(buf, 1023, "%s %s\n",
- airport->id.c_str(),
- airport->name.c_str());
- 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);