From b7e1b2ef09f24f10e79764069ab322ac750367ea Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Thu, 26 Apr 2018 22:25:47 +0200 Subject: [PATCH] miniupnpc/miniupnpcmodule.c: small fix --- miniupnpc/Changelog.txt | 4 ++++ miniupnpc/miniupnpcmodule.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/miniupnpc/Changelog.txt b/miniupnpc/Changelog.txt index 2265603..254a4ff 100644 --- a/miniupnpc/Changelog.txt +++ b/miniupnpc/Changelog.txt @@ -1,6 +1,10 @@ $Id: Changelog.txt,v 1.229 2017/12/12 11:26:25 nanard Exp $ miniUPnP client Changelog. +2018/04/26: + Small fix in miniupnpcmodule.c (python module) + Support cross compiling in Makefile.mingw + 2018/04/06: Use SOCKET type instead of int (for Win64 compilation) Increments API_VERSION to 17 diff --git a/miniupnpc/miniupnpcmodule.c b/miniupnpc/miniupnpcmodule.c index 8ffbf51..8657a0e 100644 --- a/miniupnpc/miniupnpcmodule.c +++ b/miniupnpc/miniupnpcmodule.c @@ -1,8 +1,8 @@ /* $Id: miniupnpcmodule.c,v 1.24 2014/06/10 09:48:11 nanard Exp $*/ /* Project : miniupnp * Author : Thomas BERNARD - * website : http://miniupnp.tuxfamily.org/ - * copyright (c) 2007-2016 Thomas Bernard + * website : https://miniupnp.tuxfamily.org/ + * copyright (c) 2007-2018 Thomas Bernard * This software is subjet to the conditions detailed in the * provided LICENCE file. */ #include @@ -405,14 +405,14 @@ UPnP_deleteportmappingrange(UPnPObject *self, PyObject *args) unsigned short ePortEnd; const char * proto; unsigned char manage; - char manageStr[1]; + char manageStr[6]; int r; if(!PyArg_ParseTuple(args, "HHsb", &ePortStart, &ePortEnd, &proto, &manage)) return NULL; Py_BEGIN_ALLOW_THREADS sprintf(extPortStart, "%hu", ePortStart); sprintf(extPortEnd, "%hu", ePortEnd); - sprintf(manageStr, "%hhu", manage); + sprintf(manageStr, "%hu", (unsigned short)manage); r = UPNP_DeletePortMappingRange(self->urls.controlURL, self->data.first.servicetype, extPortStart, extPortEnd, proto, manageStr); Py_END_ALLOW_THREADS