X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/record-dvb/blobdiff_plain/a8ae52732646075d54ed2e469c9bc50924725011..647c7747f9b9c0776fd4e12ef55d11e24b3495cb:/sap.c diff --git a/sap.c b/sap.c index bc51aa5..232c0c3 100644 --- a/sap.c +++ b/sap.c @@ -115,10 +115,9 @@ char *get_url_from_sap(char *service) */ pos = payload; - while(*pos != 0 && (pos-buffer) < BUFFSIZE) { - if (*pos == 0x0d) { + while(*pos != 0 && (pos-buffer) < recvd) { + if (*pos == 0x0d) *pos = 0; - } if (*pos == 0x0a) { *pos = 0; @@ -140,13 +139,11 @@ char *get_url_from_sap(char *service) poscnt++; /* c=
*/ - if (poscnt == 2) { + if (poscnt == 2) host = payload + 1; - } - if (poscnt > 2) { + if (poscnt > 2) break; - } } payload++; } @@ -160,17 +157,14 @@ char *get_url_from_sap(char *service) poscnt++; /* m= */ - if (poscnt == 1) { + if (poscnt == 1) port = payload + 1; - } - if (poscnt == 2) { + if (poscnt == 2) proto = payload + 1; - } - if (poscnt > 2) { + if (poscnt > 2) break; - } } payload++; }