[MPlayer-dev-eng] [PATCH]printf format string used everywhere
Reimar Döffinger
Reimar.Doeffinger at gmx.de
Thu Oct 7 21:09:48 CEST 2010
On Wed, Sep 15, 2010 at 01:38:28PM +0200, Frédéric Marchal wrote:
> Index: stream/librtsp/rtsp_rtp.c
> ===================================================================
> --- stream/librtsp/rtsp_rtp.c (révision 32250)
> +++ stream/librtsp/rtsp_rtp.c (copie de travail)
> @@ -218,7 +218,7 @@ parse_destination (const char *line)
> len = strlen (parse1) - strlen (parse2)
> - strlen (RTSP_SETUP_DESTINATION) + 1;
> dest = (char *) malloc (len + 1);
> - snprintf (dest, len, parse1 + strlen (RTSP_SETUP_DESTINATION));
> + snprintf (dest, len, "%s", parse1 + strlen (RTSP_SETUP_DESTINATION));
av_strlcpy ?
> Index: vidix/mtrr.c
> ===================================================================
> --- vidix/mtrr.c (révision 32250)
> +++ vidix/mtrr.c (copie de travail)
> @@ -57,7 +57,7 @@ int mtrr_set_type(unsigned base,unsigned size,int
> char sout[256];
> unsigned wr_len;
> sprintf(sout,"base=0x%08X size=0x%08X type=%s\n",base,size,stype);
> - wr_len = fprintf(mtrr_fd,sout);
> + wr_len = fprintf(mtrr_fd,"%s",sout);
> /*printf("MTRR: %s\n",sout);*/
> fclose(mtrr_fd);
> return wr_len == strlen(sout) ? 0 : EPERM;
There isn't really any point in having that intermediate sout variable.
More information about the MPlayer-dev-eng
mailing list