[MPlayer-cvslog] CVS: main/libvo vo_zr2.c,1.5,1.6

rsnel at cube.dyndns.org rsnel at cube.dyndns.org
Sat Jan 8 17:47:05 CET 2005


Hello,

On Sat, Jan 08, 2005 at 03:50:28PM +0100, Reimar D?ffinger wrote:
> On Sat, Jan 08, 2005 at 03:25:24PM +0100, Rik Snel CVS wrote:
> > +	char dev_arg_str[256];
> 
> > +	/* interpret the strings we got from subopt_parse */
> > +	if (norm_arg.len) norm = get_norm(&norm_arg);
> > +	if (dev_arg.len) {  /* produce a proper ASCIIZ from dev_arg */
> > +		memcpy(dev_arg_str, dev_arg.str, dev_arg.len);
> > +		dev_arg_str[dev_arg.len] = '\0';
> > +		dev = dev_arg_str;
> 
> I know currently len can't be bigger than 255, but I and Alexander
> decided that this should be changed, e.g. because it is often used for
> paths which can easily be larger...
> So if you have the time please use then strndup-like way that is used in
> other places (like vo_yuv4mpeg I think).

Well... I don't like the 255 char limit also. I think the better
solution will be to add a type to subopt-helper OPT_ARG_ASTR (allocated
string), which simply takes char **valp and fills it with an ASCIIZ
malloc()d copy of the argument. (it will also mean less code
duplication...)

What do you think?

Greetings,

Rik.

-- 
Nothing is ever a total loss; it can always serve as a bad example.




More information about the MPlayer-cvslog mailing list