DragonFly BSD
DragonFly submit List (threaded) for 2004-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [new function] devname_r


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sun, 4 Jan 2004 13:34:33 -0800 (PST)

: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@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@xxxxxxxxxxxxx>



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]