Commit 0d12ebe6 authored by Marius Gedminas's avatar Marius Gedminas

Use Py_ssize_t for length arguments of PyArg_ParseTuple

This API was introduced in Python 2.5 and the old one (using ints) has
been deprecated since Python 3.8.

Fixes #108.
parent 76732855
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
****************************************************************************/ ****************************************************************************/
#define PY_SSIZE_T_CLEAN
#include "Python.h" #include "Python.h"
#include "bytesobject.h" #include "bytesobject.h"
#include <time.h> #include <time.h>
...@@ -533,7 +534,8 @@ PyObject * ...@@ -533,7 +534,8 @@ PyObject *
TimeStamp_TimeStamp(PyObject *obj, PyObject *args) TimeStamp_TimeStamp(PyObject *obj, PyObject *args)
{ {
char *buf = NULL; char *buf = NULL;
int len = 0, y, mo, d, h = 0, m = 0; Py_ssize_t len = 0;
int y, mo, d, h = 0, m = 0;
double sec = 0; double sec = 0;
#ifdef PY3K #ifdef PY3K
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment