This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH,HURD] hurd: compliance fixes for getlogin_r


You can just use string_t and no need for the XXX comment.  

libc code can use C99 freely these days, so use an inline initializing
declaration rather than pre-declaring a new variable.

I don't think there's any need to iniitalize the result buffer.  We trust
the RPC stubs to return a properly-terminated string on success, and if
they didn't then that wouldn't necessarily catch it anyway.  If you want
that sort of paranoia, use __strnlen (login, sizeof login - 1).

If you've already called strlen/strnlen then don't use strncpy,
just use memcpy with the known length.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]