spartserv

Simple client and server for the spartan protocol
git clone https://noulin.net/git/spartserv.git
Log | Files | Refs | README

commit 2ae1a0b5a78b7bd8a2bc63174658cdb1db44a153
parent 3ff045674b694e691a2c8f981d30c87c5c3e89d9
Author: Remy Noulin <loader2x@gmail.com>
Date:   Fri,  6 Jan 2023 16:54:22 +0200

terminate the port string with 0

sparline.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

Diffstat:
Msparline.c | 10++++++----
1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/sparline.c b/sparline.c @@ -407,8 +407,9 @@ historyEt parseURL(char *url) { while(isdigit(*cursor)) { cursor++; } - char c = *cursor; - port = strdup(port); + char c = *cursor; + *cursor = 0; + port = strdup(port); *cursor = c; } else { @@ -627,8 +628,9 @@ int main(int ac, char **av){ while(isdigit(*cursor)) { cursor++; } - char c = *cursor; - port = strdup(port); + char c = *cursor; + *cursor = 0; + port = strdup(port); *cursor = c; } else {