[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH,HURD] hurd: compliance fixes for getlogin_r
From: |
Roland McGrath |
Subject: |
Re: [PATCH,HURD] hurd: compliance fixes for getlogin_r |
Date: |
Fri, 27 Apr 2012 15:15:42 -0700 (PDT) |
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