From 77385d56dba9eb59dce4191923d109d13b8501de Mon Sep 17 00:00:00 2001 From: Michael Gernoth Date: Sun, 6 Jun 2010 17:46:39 +0200 Subject: [PATCH] tokens can be NULL --- rigold.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rigold.c b/rigold.c index 4d4d0b3..0be124f 100644 --- a/rigold.c +++ b/rigold.c @@ -81,8 +81,12 @@ static void parse_request(int s, struct usb_dev_handle *sc) buf[ret] = 0; token = strtok_r(buf, delim, &saveptr); + if (token == NULL) + return; /* TODO: Only GET... */ token = strtok_r(NULL, delim, &saveptr); + if (token == NULL) + return; bzero(&file, sizeof(file)); strncpy(file, token, sizeof(file)-1); @@ -116,7 +120,7 @@ int main(int argc, char **argv) socklen_t slen; struct usb_dev_handle *sc; struct sockaddr_in sin, clientsin; - unsigned short port = 8888; + unsigned short port = 8088; sc = usbtmc_initscope(); -- 2.39.5