diff options
author | Chia-I Wu <[email protected]> | 2010-11-02 01:23:13 +0800 |
---|---|---|
committer | Chia-I Wu <[email protected]> | 2010-11-02 01:37:16 +0800 |
commit | ad00a92ee720c275d3852faea4e442a8da876ca2 (patch) | |
tree | 21baa089f5d88f01e29636a2113d20c65c126769 /src/egl/main/egllog.c | |
parent | 583e41855b0ae6b9a102b39ac62238472f4cf05a (diff) |
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.
Diffstat (limited to 'src/egl/main/egllog.c')
-rw-r--r-- | src/egl/main/egllog.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/egl/main/egllog.c b/src/egl/main/egllog.c index 8f3bae2243d..12c55f901a5 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, "<message truncated>"); va_end(args); logging.logger(level, msg); |