Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/lib/libform clear errno before strtol() if we're going to te...
details: https://anonhg.NetBSD.org/src/rev/ba44296d40a7
branches: trunk
changeset: 545859:ba44296d40a7
user: lukem <lukem%NetBSD.org@localhost>
date: Thu Apr 17 03:25:56 2003 +0000
description:
clear errno before strtol() if we're going to test it for ERANGE afterwards
diffstat:
lib/libform/type_ipv4.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diffs (26 lines):
diff -r 1de0524dbab4 -r ba44296d40a7 lib/libform/type_ipv4.c
--- a/lib/libform/type_ipv4.c Thu Apr 17 02:59:29 2003 +0000
+++ b/lib/libform/type_ipv4.c Thu Apr 17 03:25:56 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: type_ipv4.c,v 1.7 2003/03/09 00:57:19 lukem Exp $ */
+/* $NetBSD: type_ipv4.c,v 1.8 2003/04/17 03:25:56 lukem Exp $ */
/*-
* Copyright (c) 1998-1999 Brett Lymn
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__RCSID("$NetBSD: type_ipv4.c,v 1.7 2003/03/09 00:57:19 lukem Exp $");
+__RCSID("$NetBSD: type_ipv4.c,v 1.8 2003/04/17 03:25:56 lukem Exp $");
#include <string.h>
#include <stdlib.h>
@@ -110,6 +110,7 @@
case FORMI_HEX:
+ errno = 0;
hex_val = strtoul(buf, NULL, 16);
if ((hex_val == ULONG_MAX) && (errno == ERANGE))
goto FAIL;
Home |
Main Index |
Thread Index |
Old Index