From 2a0f97e8ad0ed8ac7456b8dc785071bf1c3a1847 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Mon, 11 Apr 2011 11:44:20 +0200 Subject: apt_pkg: Fix time_to_str, time_rfc1123 to accept more correct values (time_to_str accepts unsigned long, time_rfc1123 long long, y2k31-correct). --- python/string.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'python/string.cc') diff --git a/python/string.cc b/python/string.cc index 6a1ce4e2..a5016103 100644 --- a/python/string.cc +++ b/python/string.cc @@ -28,11 +28,11 @@ PyObject *Python(PyObject *Self,PyObject *Args) \ return CppPyString(CFunc(Str)); \ } -#define MkInt(Python,CFunc) \ +#define MkInt(Python,CFunc, ctype, pytype) \ PyObject *Python(PyObject *Self,PyObject *Args) \ { \ - int Val = 0; \ - if (PyArg_ParseTuple(Args,"i",&Val) == 0) \ + ctype Val = 0; \ + if (PyArg_ParseTuple(Args,pytype,&Val) == 0) \ return 0; \ return CppPyString(CFunc(Val)); \ } @@ -56,8 +56,8 @@ PyObject *StrBase64Encode(PyObject *Self,PyObject *Args) { MkStr(StrURItoFileName,URItoFileName); //MkFloat(StrSizeToStr,SizeToStr); -MkInt(StrTimeToStr,TimeToStr); -MkInt(StrTimeRFC1123,TimeRFC1123); +MkInt(StrTimeToStr,TimeToStr, unsigned long, "k"); +MkInt(StrTimeRFC1123,TimeRFC1123, long long, "L"); /*}}}*/ // Other String functions /*{{{*/ -- cgit v1.2.3