[MPlayer-dev-eng] [PATCH 1/3] Add mp_dir_join function.

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat Jan 29 14:34:34 CET 2011


On Sat, Jan 29, 2011 at 02:00:49PM +0100, Clément Bœsch wrote:
> On Sat, Jan 29, 2011 at 01:51:18PM +0100, Reimar Döffinger wrote:
> > On Sun, Jan 23, 2011 at 08:46:26PM +0100, Clément Bœsch wrote:
> > > +    int dirlen = strlen(dir);
> > > +    int i      = dirlen - 1;
> > 
> > 
> > > +    if (i < 0 || dir[i] == '/')
> > 
> > I do not know if it really matters, but dirlen can be < 0.
> 
> You mean i?

No, I mean dirlen, for any string larger than 2GB.

> > I can even be 0 on 64 bit systems without dir being an empty
> > string.
> > Returning NULL should be ok in these cases, but I do not
> > know if whatever the current code ends up doing is ok.
> 
> We have i < 0 just in the case of dir="".

No, for any string of length 0 or 2GB+1 to 4GB modulo 4GB


More information about the MPlayer-dev-eng mailing list