]> granicus.if.org Git - php/commitdiff
little errors cleanup
authorStanislav Malyshev <stas@php.net>
Sun, 10 May 2009 19:10:36 +0000 (19:10 +0000)
committerStanislav Malyshev <stas@php.net>
Sun, 10 May 2009 19:10:36 +0000 (19:10 +0000)
ext/intl/intl_data.h
ext/intl/intl_error.c

index 85f7d56143f105049a75848d4a9d21d73d15fc38..66ca27ae796827040acbed02ed98dd56c1608375 100755 (executable)
@@ -50,7 +50,7 @@ typedef struct _intl_data {
     intl_error_set_code( NULL, (err) TSRMLS_CC );                                                      \
     if( U_FAILURE((err)) )                                                                                                     \
     {                                                                                                                                          \
-        intl_errors_set_custom_msg( NULL, msg, 0 TSRMLS_CC );                          \
+        intl_error_set_custom_msg( NULL, msg, 0 TSRMLS_CC );                           \
         RETURN_FALSE;                                                                                                          \
     }
 
index 93cfe004ea9502bfcbb2e5f75cfde94f2a3c9a0d..15b61a78bc3cd3c51142e79a37ec83b451343332 100755 (executable)
@@ -173,7 +173,9 @@ UErrorCode intl_error_get_code( intl_error* err TSRMLS_DC )
  */
 void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TSRMLS_DC )
 {
-       intl_error_set_code( err, code TSRMLS_CC );
+       if(err) {
+               intl_error_set_code( err, code TSRMLS_CC );
+       }
        intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
 }
 /* }}} */
@@ -182,7 +184,9 @@ void intl_error_set( intl_error* err, UErrorCode code, char* msg, int copyMsg TS
  */
 void intl_errors_reset( intl_error* err TSRMLS_DC )
 {
-       intl_error_reset( err TSRMLS_CC );
+       if(err) {
+               intl_error_reset( err TSRMLS_CC );
+       }
        intl_error_reset( NULL TSRMLS_CC );
 }
 /* }}} */
@@ -191,7 +195,9 @@ void intl_errors_reset( intl_error* err TSRMLS_DC )
  */
 void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_DC )
 {
-       intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+       if(err) {
+               intl_error_set_custom_msg( err, msg, copyMsg TSRMLS_CC );
+       }
        intl_error_set_custom_msg( NULL, msg, copyMsg TSRMLS_CC );
 }
 /* }}} */
@@ -200,7 +206,9 @@ void intl_errors_set_custom_msg( intl_error* err, char* msg, int copyMsg TSRMLS_
  */
 void intl_errors_set_code( intl_error* err, UErrorCode err_code TSRMLS_DC )
 {
-       intl_error_set_code( err, err_code TSRMLS_CC );
+       if(err) {
+               intl_error_set_code( err, err_code TSRMLS_CC );
+       }
        intl_error_set_code( NULL, err_code TSRMLS_CC );
 }
 /* }}} */