From 18d54e2ae073e59e65724f2af12c69ab8c16b4db Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Wed, 20 Feb 2013 17:08:07 +0100 Subject: [PATCH] miniupnpc.c: MX cannot be 0 --- miniupnpc/miniupnpc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/miniupnpc/miniupnpc.c b/miniupnpc/miniupnpc.c index d9debde..63460bf 100644 --- a/miniupnpc/miniupnpc.c +++ b/miniupnpc/miniupnpc.c @@ -560,6 +560,10 @@ upnpDiscover(int delay, const char * multicastif, *error = UPNPDISCOVER_SUCCESS; /* Calculating maximum response time in seconds */ mx = ((unsigned int)delay) / 1000u; + if(mx == 0) { + mx = 1; + delay = 1000; + } /* receiving SSDP response packet */ for(n = 0; deviceList[deviceIndex]; deviceIndex++) {