Browse Source

Avoid const warning

bel2125 7 years ago
parent
commit
2428ade510
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/main.c

+ 3 - 2
src/main.c

@@ -1001,6 +1001,7 @@ run_client(const char *url_arg)
 	unsigned long port = 0;
 	size_t sep;
 	char *endp = 0;
+    char empty[] = "";
 
 	/* connection object */
 	struct mg_connection *conn;
@@ -1034,7 +1035,7 @@ run_client(const char *url_arg)
 	sep = strcspn(host, "/:");
 	switch (host[sep]) {
 	case 0:
-		resource = "";
+        resource = empty;
 		break;
 	case '/':
 		host[sep] = 0;
@@ -1053,7 +1054,7 @@ run_client(const char *url_arg)
 			*endp = 0;
 			resource = endp + 1;
 		} else {
-			resource = "";
+            resource = empty;
 		}
 		break;
 	default: