svn commit: r367196 - head/lib/libc/gen
Stefan Esser
se at freebsd.org
Sat Oct 31 12:14:35 UTC 2020
Sorry for the bad bug that I introduced with this attempted style fix!
The correct code has been committed as r367199.
Am 31.10.20 um 12:46 schrieb xtouqh at hotmail.com:
> Stefan Eßer wrote:
>> Author: se
>> Date: Sat Oct 31 11:44:10 2020
>> New Revision: 367196
>> URL: https://svnweb.freebsd.org/changeset/base/367196
>>
>> Log:
>> Fix style, no functional change
>> Submitted by: kib
>> MFC after: 3 days
>>
>> Modified:
>> head/lib/libc/gen/sysctl.c
>>
>> Modified: head/lib/libc/gen/sysctl.c
>> ==============================================================================
>>
>> --- head/lib/libc/gen/sysctl.c Sat Oct 31 03:36:31 2020 (r367195)
>> +++ head/lib/libc/gen/sysctl.c Sat Oct 31 11:44:10 2020 (r367196)
>> @@ -79,23 +79,23 @@ sysctl(const int *name, u_int namelen, void *oldp,
>> siz
>> switch (name[1]) {
>> case USER_CS_PATH:
>> - if (oldp && orig_oldlen < sizeof(_PATH_STDPATH)) {
>> + if (oldp == NULL && orig_oldlen < sizeof(_PATH_STDPATH)) {
>
> These checks are not identical, should not the new one be != NULL?
>
>> errno = ENOMEM;
>> - return -1;
>> + return (-1);
>> }
>> *oldlenp = sizeof(_PATH_STDPATH);
>> if (oldp != NULL)
>> memmove(oldp, _PATH_STDPATH, sizeof(_PATH_STDPATH));
>> return (0);
>> case USER_LOCALBASE:
>> - if (oldp && orig_oldlen < sizeof(_PATH_LOCALBASE)) {
>> + if (oldp == NULL && orig_oldlen < sizeof(_PATH_LOCALBASE)) {
>
> Same here.
>
>> errno = ENOMEM;
>> - return -1;
>> + return (-1);
>> }
>> *oldlenp = sizeof(_PATH_LOCALBASE);
>> if (oldp != NULL)
>> memmove(oldp, _PATH_LOCALBASE, sizeof(_PATH_LOCALBASE));
>> - return(0);
>> + return (0);
>> }
>> if (oldp && *oldlenp < sizeof(int)) {
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 495 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-head/attachments/20201031/7824adfd/attachment.sig>
More information about the svn-src-head
mailing list