rtsp: Avoid a cast when calling strtol

Message ID 1351450597-88247-1-git-send-email-martin@martin.st
State Committed
Commit f21d5c905dd5c6a56583c85623a376a029ec041a
Headers show

Commit Message

Martin Storsjö Oct. 28, 2012, 6:56 p.m.
This gets rid of this warning:

libavformat/rtsp.c: In function ‘rtsp_parse_transport’:
libavformat/rtsp.c:794: warning: cast discards qualifiers from pointer target type
---
 libavformat/rtsp.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Luca Barbato Oct. 28, 2012, 7:54 p.m. | #1
On 10/28/12 7:56 PM, Martin Storsjö wrote:
> This gets rid of this warning:
>
> libavformat/rtsp.c: In function ‘rtsp_parse_transport’:
> libavformat/rtsp.c:794: warning: cast discards qualifiers from pointer target type
> ---
>   libavformat/rtsp.c |    4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)

Assuming the compiler doesn't mess up with this change, ok.

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index aaaa0bb..13a527b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -790,8 +790,10 @@  static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
                     th->lower_transport = RTSP_LOWER_TRANSPORT_UDP_MULTICAST;
             } else if (!strcmp(parameter, "ttl")) {
                 if (*p == '=') {
+                    char *end;
                     p++;
-                    th->ttl = strtol(p, (char **)&p, 10);
+                    th->ttl = strtol(p, &end, 10);
+                    p = end;
                 }
             } else if (!strcmp(parameter, "destination")) {
                 if (*p == '=') {