com php-src: Prefer strtoll over atoll: ext/date/php_date.c main/rfc1867.c
| From: | Nikita Popov | Date: | Wed, 05 Aug 2020 16:40:23 +0000 |
| Subject: | com php-src: Prefer strtoll over atoll: ext/date/php_date.c main/rfc1867.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112588@lists.php.net to get a copy of this message | ||
Commit: 2965c8f86890c106ed34266e7bd32142cd247aea
Author: Nikita Popov <nikita.ppv@gmail.com> Wed, 5 Aug 2020 18:36:27 +0200
Parents: 74b285d78caf92364584397c2d986ad35cdeb856
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2965c8f86890c106ed34266e7bd32142cd247aea
Log:
Prefer strtoll over atoll
Both are specified by C99, but strtoll has specified overflow
behavior while atoll does not, so prefer using it.
Changed paths:
M ext/date/php_date.c
M main/rfc1867.c
Diff:
diff --git a/ext/date/php_date..c b/ext/date/php_date.c
index 8f755d887f..d81bc1659a 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -51,11 +51,7 @@ static inline long long php_date_llabs( long long i ) { return i >= 0 ? i :
-i;
int st = snprintf(s, len, "%lld", i); \
s[st] = '\0'; \
} while (0);
-#ifdef HAVE_ATOLL
-# define DATE_A64I(i, s) i = atoll(s)
-#else
-# define DATE_A64I(i, s) i = strtoll(s, NULL, 10)
-#endif
+#define DATE_A64I(i, s) i = strtoll(s, NULL, 10)
#endif
PHPAPI time_t php_time(void)
diff --git a/main/rfc1867.c b/main/rfc1867.c
index 9dcd5ad07f..8ef83f443d 100644
--- a/main/rfc1867.c
+++ b/main/rfc1867.c
@@ -31,11 +31,6 @@
#include "ext/standard/php_string.h"
#include "zend_smart_string.h"
-#if defined(PHP_WIN32) && !defined(HAVE_ATOLL)
-# define atoll(s) _atoi64(s)
-# define HAVE_ATOLL 1
-#endif
-
#ifndef DEBUG_FILE_UPLOAD
# define DEBUG_FILE_UPLOAD 0
#endif
@@ -903,11 +898,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
}
if (!strcasecmp(param, "MAX_FILE_SIZE")) {
-#ifdef HAVE_ATOLL
- max_file_size = atoll(value);
-#else
max_file_size = strtoll(value, NULL, 10);
-#endif
}
efree(param);