summaryrefslogtreecommitdiff
path: root/hw/xwin/glx
diff options
context:
space:
mode:
authorMatt Turner <mattst88@gmail.com>2010-08-27 18:34:49 -0400
committerMatt Turner <mattst88@gmail.com>2010-08-27 19:05:48 -0400
commit08adf41f6315663cbac33d010214d98f3e1c8814 (patch)
tree6589b58b25fe0cb1b1c58bb3f74058004f6fa230 /hw/xwin/glx
parentea239112b030588ed3cdd113643ba5f6207a5bd9 (diff)
Replace malloc/strlen/strcpy with strdup.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
Diffstat (limited to 'hw/xwin/glx')
-rwxr-xr-xhw/xwin/glx/indirect.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 1cf82a7cc..38918859a 100755
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -444,7 +444,7 @@ glxLogExtensions(const char *prefix, const char *extensions)
{
int length = 0;
char *strl;
- char *str = malloc(strlen(extensions) + 1);
+ char *str = strdup(extensions);
if (str == NULL)
{
@@ -452,9 +452,6 @@ glxLogExtensions(const char *prefix, const char *extensions)
return;
}
- str[strlen(extensions)] = '\0';
- strncpy (str, extensions, strlen(extensions));
-
strl = strtok(str, " ");
ErrorF("%s%s", prefix, strl);
length = strlen(prefix) + strlen(strl);