summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@python.org>2023-09-02 21:15:54 (GMT)
committerGitHub <noreply@github.com>2023-09-02 21:15:54 (GMT)
commita52213bf830226fd969dc2a2ef8006c89edecc35 (patch)
tree73ee06a56da4cf553f9abbf2328069ee18bfc3e3 /Python
parent6fafa6b919227cab06d0e3d7b20120e72d9b2bfd (diff)
downloadcpython-a52213bf830226fd969dc2a2ef8006c89edecc35.zip
cpython-a52213bf830226fd969dc2a2ef8006c89edecc35.tar.gz
cpython-a52213bf830226fd969dc2a2ef8006c89edecc35.tar.bz2
gh-108765: pystrhex: Replace stdlib.h abs() with Py_ABS() (#108830)
Diffstat (limited to 'Python')
-rw-r--r--Python/pystrhex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/Python/pystrhex.c b/Python/pystrhex.c
index ce456b7..38484f5 100644
--- a/Python/pystrhex.c
+++ b/Python/pystrhex.c
@@ -3,7 +3,6 @@
#include "Python.h"
#include "pycore_strhex.h" // _Py_strhex_with_sep()
#include "pycore_unicodeobject.h" // _PyUnicode_CheckConsistency()
-#include <stdlib.h> // abs()
static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
PyObject* sep, int bytes_per_sep_group,
@@ -44,7 +43,7 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
bytes_per_sep_group = 0;
}
- unsigned int abs_bytes_per_sep = abs(bytes_per_sep_group);
+ unsigned int abs_bytes_per_sep = Py_ABS(bytes_per_sep_group);
Py_ssize_t resultlen = 0;
if (bytes_per_sep_group && arglen > 0) {
/* How many sep characters we'll be inserting. */