[new function] devname_r

Matthew Dillon dillon at apollo.backplane.com
Sun Jan 4 13:35:57 PST 2004


:I have added a devname_r function so the BUGS part in the devname man page
:can be removed. Any feedback befor I commit it?
:This function is compatible with the FreeBSD implementation.
:
:http://eirikn.kerneled.com/dragonfly/add-devname_r.diff
:
:--=20
:Eirik Nygaard
:eirikn at xxxxxxxxxxxx

    strncpy() does not guarentee \0 termination, so use strlcpy(0
    there instead.

    If devname_r() is allowed to return a const string (i.e. not 
    necessarily use the supplied buffer), then the return type should
    be a 'const char *' instead of a 'char *'.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Submit mailing list