From ad00a92ee720c275d3852faea4e442a8da876ca2 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Tue, 2 Nov 2010 01:23:13 +0800 Subject: egl: Rework _eglGetSearchPath. So that the directory part of EGL_DRIVER, if exists, is prepended to the search path. This commit also adds a sanity check to _eglLog. --- src/egl/main/egllog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/egl/main/egllog.c') diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c index 8f3bae2243..12c55f901a 100644 --- a/src/egl/main/egllog.c +++ b/src/egl/main/egllog.c @@ -151,6 +151,7 @@ _eglLog(EGLint level, const char *fmtStr, ...) { va_list args; char msg[MAXSTRING]; + int ret; /* one-time initialization; a little race here is fine */ if (!logging.initialized) @@ -162,7 +163,9 @@ _eglLog(EGLint level, const char *fmtStr, ...) if (logging.logger) { va_start(args, fmtStr); - vsnprintf(msg, MAXSTRING, fmtStr, args); + ret = vsnprintf(msg, MAXSTRING, fmtStr, args); + if (ret < 0 || ret >= MAXSTRING) + strcpy(msg, ""); va_end(args); logging.logger(level, msg); -- cgit v1.2.3