From 4dcc1ed6540c2a44086b97d7f6e06d7b4f3ec8ab Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Thu, 31 Aug 2023 15:52:41 -0400 Subject: [PATCH] kernel: Synchronize inet_addr.c to remove advertising clause. Change-Id: I03665bcad679e3fddaea0d8a95663be12b003bd8 Reviewed-on: https://review.haiku-os.org/c/haiku/+/6877 Tested-by: Commit checker robot Reviewed-by: waddlesplash --- src/system/kernel/util/inet_addr.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/system/kernel/util/inet_addr.c b/src/system/kernel/util/inet_addr.c index dca5d40cd1..29517a2914 100644 --- a/src/system/kernel/util/inet_addr.c +++ b/src/system/kernel/util/inet_addr.c @@ -1,4 +1,6 @@ -/* +/*- + * SPDX-License-Identifier: (BSD-3-Clause AND ISC) + * * Copyright (c) 1983, 1990, 1993 * The Regents of the University of California. All rights reserved. * @@ -10,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -176,23 +174,23 @@ inet_aton(const char *cp, struct in_addr *addr) { case 2: /*%< a.b -- 8.24 bits */ if (val > 0xffffffU) return (0); - val |= parts[0] << 24; + val |= (uint32_t)parts[0] << 24; break; case 3: /*%< a.b.c -- 8.8.16 bits */ if (val > 0xffffU) return (0); - val |= (parts[0] << 24) | (parts[1] << 16); + val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16); break; case 4: /*%< a.b.c.d -- 8.8.8.8 bits */ if (val > 0xffU) return (0); - val |= (parts[0] << 24) | (parts[1] << 16) | (parts[2] << 8); + val |= ((uint32_t)parts[0] << 24) | (parts[1] << 16) | + (parts[2] << 8); break; } if (addr != NULL) addr->s_addr = htonl(val); return (1); } -