aboutsummaryrefslogtreecommitdiff
path: root/pugl
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2015-11-11 17:59:31 -0500
committerDavid Robillard <d@drobilla.net>2015-11-11 17:59:31 -0500
commitdb28e6c8e3dc2d148ae14b2c7bf14b63c1237cb6 (patch)
tree8587d475f76bb70406bd5255517e3963aeaf1fd5 /pugl
parent95a42df7a459fb089d2d55b52c7c84f2a296c0f4 (diff)
downloadsynthpod-db28e6c8e3dc2d148ae14b2c7bf14b63c1237cb6.tar.xz
Avoid use of strdup
Diffstat (limited to 'pugl')
-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 7dc9cfa1..bef83993 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