From 06ce7ae9289a80165fe3b975d3e8e51f5aea57ae Mon Sep 17 00:00:00 2001 From: ehofman Date: Fri, 28 Nov 2003 10:25:33 +0000 Subject: [PATCH] IRIX/MipsPro 7.2 doesn't have strndup. Work around it. --- src/GUI/AirportList.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/GUI/AirportList.cxx b/src/GUI/AirportList.cxx index 43cee70ab..3f97342de 100644 --- a/src/GUI/AirportList.cxx +++ b/src/GUI/AirportList.cxx @@ -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); -- 2.39.5