]> git.mxchange.org Git - flightgear.git/commitdiff
waypointList: stop using GNU extension / C99 features.
authorjmt <jmt>
Tue, 23 Feb 2010 00:17:53 +0000 (00:17 +0000)
committerTim Moore <timoore33@gmail.com>
Tue, 23 Feb 2010 07:53:46 +0000 (08:53 +0100)
src/GUI/WaypointList.cxx

index 0ad02a30dd1549d9ce9f2256b87f1097a2e399c0..5498076e54572bc73906fa84a72f50a76e3d5c8b 100644 (file)
@@ -108,15 +108,14 @@ static void drawClippedString(puFont& font, const char* s, int x, int y, int max
     return;
   }
   
-  int len = strlen(s);
-  char buf[len];
-  memcpy(buf, s, len);
+  std::string buf(s);
+  int len = buf.size();
   do {
-    buf[--len] = 0;
-    fullWidth = font.getStringWidth(buf);
+    buf.resize(--len);
+    fullWidth = font.getStringWidth(buf.c_str());
   } while (fullWidth > maxWidth);
   
-  font.drawString(buf, x, y);
+  font.drawString(buf.c_str(), x, y);
 }
 
 //////////////////////////////////////////////////////////////////////////////