Letting "ls -l" display file permissions in octal

A.J. 'Fonz' van Werven freebsd at skysmurf.nl
Tue Apr 8 20:39:16 UTC 2014


Please note: someone else on the forums spotted a bug in my code: the
snprintf() call in octalmode() in print.c uses sizeof, which actually
refers to the size of the pointer rather than the size of the buffer
itself. I've updated the patch to just use the literal value 6 instead
(four octal digits, a space reserved for aclmode() and a terminating \0).
Since the length of said buffer has been hardcoded to 20 in the calling
function (I didn't do that, BTW), I think that should be ok.

AvW

-- 
I'm not completely useless, I can be used as a bad example.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 834 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20140408/65120df4/attachment-0001.sig>


More information about the freebsd-hackers mailing list