Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit a52213b

Browse files
authored
gh-108765: pystrhex: Replace stdlib.h abs() with Py_ABS() (#108830)
1 parent 6fafa6b commit a52213b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

Python/pystrhex.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "Python.h"
44
#include "pycore_strhex.h" // _Py_strhex_with_sep()
55
#include "pycore_unicodeobject.h" // _PyUnicode_CheckConsistency()
6-
#include <stdlib.h> // abs()
76

87
static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
98
PyObject* sep, int bytes_per_sep_group,
@@ -44,7 +43,7 @@ static PyObject *_Py_strhex_impl(const char* argbuf, const Py_ssize_t arglen,
4443
bytes_per_sep_group = 0;
4544
}
4645

47-
unsigned int abs_bytes_per_sep = abs(bytes_per_sep_group);
46+
unsigned int abs_bytes_per_sep = Py_ABS(bytes_per_sep_group);
4847
Py_ssize_t resultlen = 0;
4948
if (bytes_per_sep_group && arglen > 0) {
5049
/* How many sep characters we'll be inserting. */

0 commit comments

Comments
 (0)