From 8844cb029149403a04e4fb90d7c4d3aeb52d95f4 Mon Sep 17 00:00:00 2001 From: Alban Browaeys Date: Wed, 26 Jan 2011 19:36:31 +0100 Subject: [PATCH] locale to C for atof in glxext.c --- src/glx/glxext.c | 13 ++++++++++++- 1 files changed, 12 insertions(+), 1 deletions(-) diff --git a/src/glx/glxext.c b/src/glx/glxext.c index c5e9d05..c388706 100644 --- a/src/glx/glxext.c +++ b/src/glx/glxext.c @@ -39,6 +39,7 @@ #include #include "glxclient.h" +#include #include #include #ifdef GLX_USE_APPLEGL @@ -673,6 +674,8 @@ static GLboolean xGLXVendorPrivateWithReplyReq *vpreq; xGLXGetFBConfigsReply reply; Display *dpy = priv->dpy; + char *old_locale, *saved_locale; + float version; psc->serverGLXexts = __glXQueryServerString(dpy, priv->majorOpcode, screen, GLX_EXTENSIONS); @@ -680,7 +683,15 @@ static GLboolean LockDisplay(dpy); psc->configs = NULL; - if (atof(priv->serverGLXversion) >= 1.3) { + old_locale = setlocale (LC_ALL, NULL); + saved_locale = strdup (old_locale); + setlocale(LC_ALL, "C"); + if (saved_locale == NULL) + goto out; + version = atof(priv->serverGLXversion); + setlocale (LC_ALL, saved_locale); + free (saved_locale); + if (version >= 1.3) { GetReq(GLXGetFBConfigs, fb_req); fb_req->reqType = priv->majorOpcode; fb_req->glxCode = X_GLXGetFBConfigs; -- 1.7.2.3