[MPlayer-dev-eng] [PATCH] demuxer-independent sub and audio track selection

Reimar Döffinger Reimar.Doeffinger at stud.uni-karlsruhe.de
Mon Feb 25 19:41:25 CET 2008


Hello,
On Mon, Feb 25, 2008 at 07:44:32PM +0200, Uoti Urpala wrote:
> On Sun, 2008-02-24 at 16:31 +0100, Reimar Döffinger wrote:
> > > +                strncpy(lang, sh->lang, 39);
> > > +                lang[39] = 0;
> 
> > strncpy should be considered forbidden for new code, use av_strlcpy.
> 
> I think "forbidden" is too strong when it's two lines of standard code
> vs a nonstandard function.

First, note that it is "should be considered forbidden" which is
somewhat different.
Second, this IMO is not "two lines of standard code vs a nonstandard function"
but "two lines of code, out of which most new submitters forget one and
get the other wrong vs. a function that behaves as most expect the
standard one to behave".
The corollary being that not strongly discouraging strncpy tends to mean more
work for both patch submitters and reviewers.

Greetings,
Reimar Döffinger



More information about the MPlayer-dev-eng mailing list