Revision: 16636
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16636
Author:   ton
Date:     2008-09-20 16:43:59 +0200 (Sat, 20 Sep 2008)

Log Message:
-----------
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.

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/dynlib.c

Modified: trunk/blender/source/blender/blenlib/intern/dynlib.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/dynlib.c        2008-09-20 
13:22:30 UTC (rev 16635)
+++ trunk/blender/source/blender/blenlib/intern/dynlib.c        2008-09-20 
14:43:59 UTC (rev 16636)
@@ -77,12 +77,12 @@
        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 @@
                        return buf;
        }
        
-       return NULL;
+       return "unrecognized error";
 }
 
 void PIL_dynlib_close(PILdynlib *lib) {


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to