aboutsummaryrefslogtreecommitdiff
path: root/external/miniupnpc/upnpc.c
diff options
context:
space:
mode:
authorRiccardo Spagni <ric@spagni.net>2016-03-21 13:37:54 +0200
committerRiccardo Spagni <ric@spagni.net>2016-03-21 13:37:54 +0200
commita4242c42b24d936c1ca79f98aa1062177c222c04 (patch)
treed666acda26cc849763daa123314b0bc85c8d275c /external/miniupnpc/upnpc.c
parentMerge pull request #743 (diff)
downloadmonero-a4242c42b24d936c1ca79f98aa1062177c222c04.tar.xz
update miniupnpc
Diffstat (limited to 'external/miniupnpc/upnpc.c')
-rw-r--r--external/miniupnpc/upnpc.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/external/miniupnpc/upnpc.c b/external/miniupnpc/upnpc.c
index 1a910ccdc..94f131c87 100644
--- a/external/miniupnpc/upnpc.c
+++ b/external/miniupnpc/upnpc.c
@@ -1,7 +1,7 @@
-/* $Id: upnpc.c,v 1.111 2015/07/23 20:40:10 nanard Exp $ */
+/* $Id: upnpc.c,v 1.114 2016/01/22 15:04:23 nanard Exp $ */
/* Project : miniupnp
* Author : Thomas Bernard
- * Copyright (c) 2005-2015 Thomas Bernard
+ * Copyright (c) 2005-2016 Thomas Bernard
* This software is subject to the conditions detailed in the
* LICENCE file provided in this distribution. */
@@ -66,7 +66,7 @@ static void DisplayInfos(struct UPNPUrls * urls,
char connectionType[64];
char status[64];
char lastconnerr[64];
- unsigned int uptime;
+ unsigned int uptime = 0;
unsigned int brUp, brDown;
time_t timenow, timestarted;
int r;
@@ -82,9 +82,11 @@ static void DisplayInfos(struct UPNPUrls * urls,
else
printf("Status : %s, uptime=%us, LastConnectionError : %s\n",
status, uptime, lastconnerr);
- timenow = time(NULL);
- timestarted = timenow - uptime;
- printf(" Time started : %s", ctime(&timestarted));
+ if(uptime > 0) {
+ timenow = time(NULL);
+ timestarted = timenow - uptime;
+ printf(" Time started : %s", ctime(&timestarted));
+ }
if(UPNP_GetLinkLayerMaxBitRates(urls->controlURL_CIF, data->CIF.servicetype,
&brDown, &brUp) != UPNPCOMMAND_SUCCESS) {
printf("GetLinkLayerMaxBitRates failed.\n");
@@ -538,7 +540,7 @@ int main(int argc, char ** argv)
char ** commandargv = 0;
int commandargc = 0;
struct UPNPDev * devlist = 0;
- char lanaddr[64]; /* my ip address on the LAN */
+ char lanaddr[64] = "unset"; /* my ip address on the LAN */
int i;
const char * rootdescurl = 0;
const char * multicastif = 0;
@@ -560,7 +562,7 @@ int main(int argc, char ** argv)
}
#endif
printf("upnpc : miniupnpc library test client, version %s.\n", MINIUPNPC_VERSION_STRING);
- printf(" (c) 2005-2015 Thomas Bernard.\n");
+ printf(" (c) 2005-2016 Thomas Bernard.\n");
printf("Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/\n"
"for more information.\n");
/* command line processing */