diff options
author | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-08-04 14:39:02 +0200 |
---|---|---|
committer | Lars-Dominik Braun <PromyLOPh@lavabit.com> | 2009-08-04 14:39:02 +0200 |
commit | 98071f0c542a89379c21ba69ea14a5c3f4b88b61 (patch) | |
tree | aef7caab5b4be1c6849f9d8f8f05c29390d9d751 | |
parent | 542c4c17be349fc97fef2a06fb68b0a41cf2a033 (diff) | |
download | pianobar-windows-98071f0c542a89379c21ba69ea14a5c3f4b88b61.tar.gz pianobar-windows-98071f0c542a89379c21ba69ea14a5c3f4b88b61.tar.bz2 pianobar-windows-98071f0c542a89379c21ba69ea14a5c3f4b88b61.zip |
waitress: Fix another valgrind warning in WaitressSplitUrl
-rw-r--r-- | libwaitress/src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/libwaitress/src/main.c b/libwaitress/src/main.c index ab326cd..a54c864 100644 --- a/libwaitress/src/main.c +++ b/libwaitress/src/main.c @@ -122,7 +122,8 @@ char WaitressSplitUrl (const char *url, char *retHost, size_t retHostSize, lastPos = urlPos; /* find host */ - while (*urlPos != ':' && *urlPos != '/' && urlPos - lastPos < retHostSize-1) { + while (*urlPos != '\0' && *urlPos != ':' && *urlPos != '/' && + urlPos - lastPos < retHostSize-1) { *retHost++ = *urlPos++; } lastPos = urlPos; @@ -132,14 +133,16 @@ char WaitressSplitUrl (const char *url, char *retHost, size_t retHostSize, /* skip : */ ++urlPos; ++lastPos; - while (*urlPos != '/' && urlPos - lastPos < retPortSize-1) { + while (*urlPos != '\0' && *urlPos != '/' && + urlPos - lastPos < retPortSize-1) { *retPort++ = *urlPos++; } } lastPos = urlPos; /* path */ - while (*urlPos != '\0' && *urlPos != '#' && urlPos - lastPos < retPathSize-1) { + while (*urlPos != '\0' && *urlPos != '#' && + urlPos - lastPos < retPathSize-1) { *retPath++ = *urlPos++; } } else { |