diff options
author | Ton Roosendaal <ton@blender.org> | 2008-09-20 18:43:59 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2008-09-20 18:43:59 +0400 |
commit | 768e12a064cf524a14a84203b100a33235bba30e (patch) | |
tree | 8b2474c27e3a9a6ae07516776ef063b792c4df45 /source/blender/blenlib/intern/dynlib.c | |
parent | 0a364788c1f9007163b7d799d4758555af29b3be (diff) |
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.
Diffstat (limited to 'source/blender/blenlib/intern/dynlib.c')
-rw-r--r-- | source/blender/blenlib/intern/dynlib.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) { |