* src/native/native.cpp: Fixed bogus log_print calls. Please don't use strings
authorMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 28 Oct 2009 11:00:41 +0000 (12:00 +0100)
committerMichael Starzinger <michi@complang.tuwien.ac.at>
Wed, 28 Oct 2009 11:00:41 +0000 (12:00 +0100)
that are dynamically generated as format strings, this is dangerous.

src/native/native.cpp

index e5e2c7c6272ec3aae80fce5c56006960ea78f5c2..5515218363e8f88cbeac21682ac5d3dd05734205 100644 (file)
@@ -504,12 +504,8 @@ void* NativeLibrary::open()
                if (opt_verbosejni)
                        printf("failed ]\n");
 
-               if (opt_verbose) {
-                       log_start();
-                       log_print("NativeLibrary::open: os::dlopen failed: ");
-                       log_print(os::dlerror());
-                       log_finish();
-               }
+               if (opt_PrintWarnings)
+                       log_println("NativeLibrary::open: os::dlopen failed: %s", os::dlerror());
 
                return NULL;
        }
@@ -544,12 +540,8 @@ void NativeLibrary::close()
                if (opt_verbosejni)
                        printf("failed ]\n");
 
-               if (opt_verbose) {
-                       log_start();
-                       log_print("NativeLibrary::close: os::dlclose failed: ");
-                       log_print(os::dlerror());
-                       log_finish();
-               }
+               if (opt_PrintWarnings)
+                       log_println("NativeLibrary::close: os::dlclose failed: %s", os::dlerror());
        }
 
        if (opt_verbosejni)