Module Name: src
Committed By: christos
Date: Tue Mar 10 13:00:58 UTC 2015
Modified Files:
src/lib/libc/stdlib: strtol.3 strtoul.3
Log Message:
PR/49640: Kamil Rytarowski: Improve error printing
To generate a diff of this commit:
cvs rdiff -u -r1.29 -r1.30 src/lib/libc/stdlib/strtol.3
cvs rdiff -u -r1.28 -r1.29 src/lib/libc/stdlib/strtoul.3
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libc/stdlib/strtol.3
diff -u src/lib/libc/stdlib/strtol.3:1.29 src/lib/libc/stdlib/strtol.3:1.30
--- src/lib/libc/stdlib/strtol.3:1.29 Sun Jan 18 13:01:41 2015
+++ src/lib/libc/stdlib/strtol.3 Tue Mar 10 09:00:58 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: strtol.3,v 1.29 2015/01/18 18:01:41 christos Exp $
+.\" $NetBSD: strtol.3,v 1.30 2015/03/10 13:00:58 christos Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" from: @(#)strtol.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd December 27, 2014
+.Dd Match 10, 2015
.Dt STRTOL 3
.Os
.Sh NAME
@@ -243,7 +243,7 @@ function is the simplest to use:
int e;
intmax_t lval = strtoi(buf, NULL, 0, 1, 99, &e);
if (e)
- warn("conversion of `%s' to a number failed, using %jd",
+ warnc(e, "conversion of `%s' to a number failed, using %jd",
buf, lval);
.Ed
.Pp
Index: src/lib/libc/stdlib/strtoul.3
diff -u src/lib/libc/stdlib/strtoul.3:1.28 src/lib/libc/stdlib/strtoul.3:1.29
--- src/lib/libc/stdlib/strtoul.3:1.28 Sun Jan 18 13:01:41 2015
+++ src/lib/libc/stdlib/strtoul.3 Tue Mar 10 09:00:58 2015
@@ -1,4 +1,4 @@
-.\" $NetBSD: strtoul.3,v 1.28 2015/01/18 18:01:41 christos Exp $
+.\" $NetBSD: strtoul.3,v 1.29 2015/03/10 13:00:58 christos Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" from: @(#)strtoul.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd December 27, 2014
+.Dd March 10, 2015
.Dt STRTOUL 3
.Os
.Sh NAME
@@ -240,7 +240,7 @@ function is the simplest to use:
int e;
uintmax_t lval = strtou(buf, NULL, 0, 1, 99, &e);
if (e)
- warn("conversion of `%s' to a number failed, using %ju",
+ warnc(e, "conversion of `%s' to a number failed, using %ju",
buf, lval);
.Ed
.Pp