Use X_LIBS from pkg-config, instead of libdir, for locating libX11
[mesa.git] / progs / xdemos / sharedtex_mt.c
index f924448cc436444b520bf3f52297b314f53a69d3..a90903adeca7e098ffa8daf510d78aa97f766d2d 100644 (file)
@@ -174,6 +174,10 @@ AddWindow(Display *dpy, const char *displayName, int xpos, int ypos,
    {
       static int id = 0;
       struct window *h = &Windows[NumWindows];
+      if (strlen(displayName) + 1 > sizeof(h->DisplayName)) {
+         Error(displayName, "string overflow");
+         return NULL;
+      }
       strcpy(h->DisplayName, displayName);
       h->Dpy = dpy;
       h->Win = win;