[vlc-devel] [PATCH 2/2] misc/rtsp: Clarify conditional assignment

Rémi Denis-Courmont remi at remlab.net
Thu Oct 3 17:41:11 CEST 2019


Le torstaina 3. lokakuuta 2019, 18.10.37 EEST Marvin Scholz a écrit :
> Found by lgtm.com
> ---
>  modules/misc/rtsp.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/modules/misc/rtsp.c b/modules/misc/rtsp.c
> index d90f754357..1940aeb731 100644
> --- a/modules/misc/rtsp.c
> +++ b/modules/misc/rtsp.c
> @@ -1251,7 +1251,7 @@ static int RtspCallback( httpd_callback_sys_t *p_args,
> httpd_client_t *cl, httpd_MsgAdd( answer, "Server", "VLC/%s", VERSION );
>      httpd_MsgAdd( answer, "Content-Length", "%d", answer->i_body );
>      psz_cseq = httpd_MsgGet( query, "Cseq" );
> -    psz_cseq ? i_cseq = atoi( psz_cseq ) : 0;
> +    i_cseq = (psz_cseq) ? atoi( psz_cseq ) : 0;
>      httpd_MsgAdd( answer, "CSeq", "%d", i_cseq );
>      httpd_MsgAdd( answer, "Cache-Control", "%s", "no-cache" );

This does not clarify the assignment.
It changes the semantics, the side effects.

(And I don't know if it's right or wrong.)

-- 
Rémi Denis-Courmont
http://www.remlab.net/





More information about the vlc-devel mailing list