Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.sbin/inetd Summary: char is unsigned on arm, so use int ...
details: https://anonhg.NetBSD.org/src/rev/a9094214b201
branches: trunk
changeset: 1023225:a9094214b201
user: tih <tih%NetBSD.org@localhost>
date: Mon Aug 30 06:27:49 2021 +0000
description:
Summary: char is unsigned on arm, so use int when -1 indicates error
hex_to_bits() returns -1 on error, so declare it int, and do the same
for the variables that hold intermediate values returned by it.
diffstat:
usr.sbin/inetd/parse_v2.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diffs (45 lines):
diff -r a1d146b3ec6a -r a9094214b201 usr.sbin/inetd/parse_v2.c
--- a/usr.sbin/inetd/parse_v2.c Mon Aug 30 05:57:51 2021 +0000
+++ b/usr.sbin/inetd/parse_v2.c Mon Aug 30 06:27:49 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: parse_v2.c,v 1.1 2021/08/29 09:54:18 christos Exp $ */
+/* $NetBSD: parse_v2.c,v 1.2 2021/08/30 06:27:49 tih Exp $ */
/*-
* Copyright (c) 2021 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: parse_v2.c,v 1.1 2021/08/29 09:54:18 christos Exp $");
+__RCSID("$NetBSD: parse_v2.c,v 1.2 2021/08/30 06:27:49 tih Exp $");
#include <ctype.h>
#include <errno.h>
@@ -95,7 +95,7 @@
static bool infer_protocol_ip_version(struct servtab *);
static bool setup_internal(struct servtab *);
static void try_infer_socktype(struct servtab *);
-char hex_to_bits(char);
+int hex_to_bits(char);
#ifdef IPSEC
static void setup_ipsec(struct servtab *);
#endif
@@ -405,7 +405,7 @@
cp++;
switch (*cp) {
case 'x': {
- char temp, bits;
+ int temp, bits;
if (((bits = hex_to_bits(*(cp + 1))) == -1)
|| ((temp = hex_to_bits(*(cp + 2))) == -1)) {
ERR("Invalid hexcode sequence '%.4s'",
@@ -459,7 +459,7 @@
return true;
}
-char
+int
hex_to_bits(char in)
{
switch(in) {
Home |
Main Index |
Thread Index |
Old Index