tHandle corner case when no item is specified - phroxy - Gopher to HTTP proxy
(HTM) git clone git://git.z3bra.org/phroxy.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit fcf983a1138c7e93933c3722ec8735b92d57432b
(DIR) parent 6080677947fba31e72da83dd8a881de1e37daf15
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Mon, 14 Sep 2020 16:21:15 +0200
Handle corner case when no item is specified
Diffstat:
M phroxy.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
(DIR) diff --git a/phroxy.c b/phroxy.c
t@@ -343,7 +343,7 @@ phroxy(char *url)
{
int sock;
size_t len;
- char item;
+ char item = 0;
char *hole, *path, *host, *port;
char *data = NULL, *srch = NULL;
t@@ -359,7 +359,9 @@ phroxy(char *url)
if (!port)
port = "70";
- item = *url++;
+ if (url)
+ item = *url++;
+
if (!item)
item = '1';