On Sat, 2019-04-06 at 01:47 +1100, Bruce Evans wrote:
> On Fri, 5 Apr 2019, Ed Maste wrote:
> 
> > On Fri, 5 Apr 2019 at 00:49, Rodney W. Grimes <free...@gndrsh.dnsmgr.net> 
> > wrote:
> >>
> >
> >>> +static const u_char dot_name[] = {
> >>> +     '.', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
> >>> +static const u_char dotdot_name[] = {
> >>> +     '.', '.',' ',' ',' ',' ',' ',' ',' ',' ',' ' };
> >>> +
> >>
> >> Does it make since to encode these as hex or octal constants,
> >> one can not tell that those are different values in an easy
> >> manner.  They all look like '.' in the diff, and probably
> >> in most editors.
> 
> No, but it makes sense to write them as string constants.  They are just
> the strings "." and ".." padded with spaces to length 11, except they
> are not actually strings since they are not NUL terminated.  11 is for
> 8+3 msdos short file names.  These are not NUL terminated either, but
> it should be easy to ignore the extra NUL given by the string constants.
> 

Defining them as nulterminated strings will also affect
sizeof(dot_name), better make sure nothing relies on that.

-- Ian


_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to