]> granicus.if.org Git - php/commitdiff
date module, replacing abs call with the llabs's like one due to bigger type
authorDavid Carlier <devnexen@gmail.com>
Sat, 4 Nov 2017 22:08:10 +0000 (22:08 +0000)
committerJoe Watkins <krakjoe@php.net>
Tue, 7 Nov 2017 05:27:27 +0000 (05:27 +0000)
ext/date/php_date.c

index ab6c2889435939e36d36e5533c2b12939737a85f..3cf4dd789c07f3e7dc760142f8c322f82afcf236 100644 (file)
@@ -2290,8 +2290,8 @@ static HashTable *date_object_get_properties(zval *object) /* {{{ */
 
                                ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
                                        utc_offset < 0 ? '-' : '+',
-                                       abs(utc_offset / 3600),
-                                       abs(((utc_offset % 3600) / 60)));
+                                       php_date_llabs(utc_offset / 3600),
+                                       php_date_llabs(((utc_offset % 3600) / 60)));
 
                                ZVAL_NEW_STR(&zv, tmpstr);
                                }
@@ -2382,8 +2382,8 @@ static HashTable *date_object_get_properties_timezone(zval *object) /* {{{ */
 
                        ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
                                tzobj->tzi.utc_offset < 0 ? '-' : '+',
-                               abs(tzobj->tzi.utc_offset / 3600),
-                               abs(((tzobj->tzi.utc_offset % 3600) / 60)));
+                               php_date_llabs(tzobj->tzi.utc_offset / 3600),
+                               php_date_llabs(((tzobj->tzi.utc_offset % 3600) / 60)));
 
                        ZVAL_NEW_STR(&zv, tmpstr);
                        }
@@ -3912,8 +3912,8 @@ PHP_FUNCTION(timezone_name_get)
 
                        ZSTR_LEN(tmpstr) = snprintf(ZSTR_VAL(tmpstr), sizeof("+05:00"), "%c%02d:%02d",
                                utc_offset < 0 ? '-' : '+',
-                               abs(utc_offset / 3600),
-                               abs(((utc_offset % 3600) / 60)));
+                               php_date_llabs(utc_offset / 3600),
+                               php_date_llabs(((utc_offset % 3600) / 60)));
 
                        RETURN_NEW_STR(tmpstr);
                        }