summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon TURNEY <jon.turney@dronecode.org.uk>2012-01-31 13:14:23 +0000
committerJon TURNEY <jon.turney@dronecode.org.uk>2012-03-10 13:26:31 +0000
commit0522535886e4e0849ca82d8a3990ed634b411e56 (patch)
tree6c4fb2f6da048083dff69b8da6fdb21b3fe694e7
parentac9fc2ccfd541e76a076a3452e5dc17d7c43a7ec (diff)
hw/xwin/glx: Fix glxLogExtensions to handle a null string without crashing
Also fix a warning in glxLogExtensions() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
-rw-r--r--hw/xwin/glx/indirect.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/hw/xwin/glx/indirect.c b/hw/xwin/glx/indirect.c
index 86fef55d1..3af61e9c5 100644
--- a/hw/xwin/glx/indirect.c
+++ b/hw/xwin/glx/indirect.c
@@ -469,7 +469,7 @@ static void
glxLogExtensions(const char *prefix, const char *extensions)
{
int length = 0;
- char *strl;
+ const char *strl;
char *str = strdup(extensions);
if (str == NULL)
@@ -479,6 +479,7 @@ glxLogExtensions(const char *prefix, const char *extensions)
}
strl = strtok(str, " ");
+ if (strl == NULL) strl = "";
ErrorF("%s%s", prefix, strl);
length = strlen(prefix) + strlen(strl);