From 08adf41f6315663cbac33d010214d98f3e1c8814 Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Fri, 27 Aug 2010 18:34:49 -0400 Subject: Replace malloc/strlen/strcpy with strdup. Reviewed-by: Jeremy Huddleston Signed-off-by: Matt Turner --- hw/xwin/glx/indirect.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'hw/xwin/glx') 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); -- cgit v1.2.3