aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pugl/pugl_internal.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/pugl/pugl_internal.h b/pugl/pugl_internal.h
index 7dc9cfa..bef8399 100644
--- a/pugl/pugl_internal.h
+++ b/pugl/pugl_internal.h
@@ -28,6 +28,9 @@
PUGL_HAVE_GL: Include OpenGL support code.
*/
+#include <stdlib.h>
+#include <string.h>
+
#include "pugl/pugl.h"
#include "pugl/event.h"
@@ -120,8 +123,11 @@ puglInitWindowAspectRatio(PuglView* view,
void
puglInitWindowClass(PuglView* view, const char* name)
{
+ const size_t len = strlen(name);
+
free(view->windowClass);
- view->windowClass = strdup(name);
+ view->windowClass = (char*)calloc(1, len + 1);
+ memcpy(view->windowClass, name, len);
}
void