From 768e12a064cf524a14a84203b100a33235bba30e Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 20 Sep 2008 14:43:59 +0000 Subject: Patch #17631 by Early Ehlinger His log: One of the calls to PIL_dynlib_get_error_as_string was assuming that it would return a valid string and not NULL (perhaps by converting to std::string). This patch simply changes it to always return a string, even when the error is not recognized. --- source/blender/blenlib/intern/dynlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/blenlib') diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c index c4692995f20..e7fa3332f43 100644 --- a/source/blender/blenlib/intern/dynlib.c +++ b/source/blender/blenlib/intern/dynlib.c @@ -77,12 +77,12 @@ char *PIL_dynlib_get_error_as_string(PILdynlib* lib) { int err; /* if lib is NULL reset the last error code */ + err= GetLastError(); if (!lib) { SetLastError(ERROR_SUCCESS); - return NULL; + err = ERROR_SUCCESS; } - err= GetLastError(); if (err) { static char buf[1024]; @@ -96,7 +96,7 @@ char *PIL_dynlib_get_error_as_string(PILdynlib* lib) { return buf; } - return NULL; + return "unrecognized error"; } void PIL_dynlib_close(PILdynlib *lib) { -- cgit v1.2.3