[MPlayer-dev-eng] [PATCH 1/4] String handling audit/cleanup

Alex Beregszaszi alex at rtfs.hu
Fri Mar 2 22:15:25 CET 2007


Hi,

> > in cpudetect.c:
> > 
> > -       sprintf(vendor,"%.4s%.4s%.4s",(char*)(regs+1),(char*)(regs
> > +3),(char*)(regs+2));
> > +       snprintf(vendor, sizeof vendor, "%.4s%.4s%.4s",(char*)(regs
> > +1),(char*)(regs+3),(char*)(regs+2));
> > 
> > change this to sizeof(vendor)
> 
> Is there a reason you prefer this style? It's correct as written.
> Parentheses with sizeof are for sizeof(type) as opposed to
> sizeof lvalue.

Consistency to other parts of the code. We use sizeof() in ffmpeg and
mplayer.

--
Alex Beregszaszi




More information about the MPlayer-dev-eng mailing list