From: Michael Gernoth Date: Sun, 6 Jun 2010 15:46:39 +0000 (+0200) Subject: tokens can be NULL X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/rigol/commitdiff_plain/77385d56dba9eb59dce4191923d109d13b8501de?ds=sidebyside;hp=ad9fbc05e664d9e4028ec9c17fcc7308a4524114 tokens can be NULL --- 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();