]> granicus.if.org Git - icu/commitdiff
ICU-10439 fix sprintf(%s,NULL)
authorSteven R. Loomis <srl@icu-project.org>
Tue, 24 Sep 2013 23:40:46 +0000 (23:40 +0000)
committerSteven R. Loomis <srl@icu-project.org>
Tue, 24 Sep 2013 23:40:46 +0000 (23:40 +0000)
X-SVN-Rev: 34469

icu4c/source/test/intltest/intltest.cpp

index c788e9a96dbb2b9a0e454dbb17f6116e66b0bf2a..8a717e4ad894810c66dd39d7e99585874bc3ae87 100644 (file)
@@ -1790,6 +1790,9 @@ UBool IntlTest::assertFalse(const char* message, UBool condition, UBool quiet) {
 }
 
 UBool IntlTest::assertSuccess(const char* message, UErrorCode ec, UBool possibleDataError, const char *file, int line) {
+    if( file==NULL ) {
+      file = ""; // prevent failure if no file given
+    }
     if (U_FAILURE(ec)) {
         if (possibleDataError) {
           dataerrln("FAIL: %s:%d: %s (%s)", file, line, message, u_errorName(ec));