From c38fcd30c79b4872914e17f5d5ad89b73d572292 Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 1 Jun 2004 01:28:40 +0000 Subject: icyName fix git-svn-id: https://svn.musicpd.org/mpd/trunk@1271 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/inputStream_http.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/inputStream_http.c b/src/inputStream_http.c index 5a4aef2d8..696920ab5 100644 --- a/src/inputStream_http.c +++ b/src/inputStream_http.c @@ -368,20 +368,24 @@ static int getHTTPHello(InputStream * inStream) { data->icyMetaint = atoi(cur+14); } else if(0 == strncmp(cur, "\r\nicy-name:", 11)) { - char * temp = strstr(cur+11,"\r\n"); + int incr = 11; + char * temp = strstr(cur+incr,"\r\n"); if(!temp) break; *temp = '\0'; if(inStream->metaTitle) free(inStream->metaTitle); - inStream->metaTitle = strdup(cur+19); + while(*(incr+cur) == ' ') incr++; + inStream->metaTitle = strdup(cur+incr); *temp = '\r'; DEBUG("stream icy-name: %s\n", inStream->metaTitle); } else if(0 == strncmp(cur, "\r\nx-audiocast-name:", 19)) { - char * temp = strstr(cur+19,"\r\n"); + int incr = 19; + char * temp = strstr(cur+incr,"\r\n"); if(!temp) break; *temp = '\0'; if(inStream->metaTitle) free(inStream->metaTitle); - inStream->metaTitle = strdup(cur+19); + while(*(incr+cur) == ' ') incr++; + inStream->metaTitle = strdup(cur+incr); *temp = '\r'; DEBUG("stream audiocast-name: %s\n", inStream->metaTitle); -- cgit v1.2.3