summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2014-05-09 05:14:17 +0000
committerderaadt <deraadt@openbsd.org>2014-05-09 05:14:17 +0000
commit83068495a49f6442f2ee0f06590c3c0d3fe11915 (patch)
tree796c22eb430d6d8358c87fb2bc90b955e17f8a81
parentstop using B_AGE, it was effectively retired some time ago. (diff)
downloadwireguard-openbsd-83068495a49f6442f2ee0f06590c3c0d3fe11915.tar.xz
wireguard-openbsd-83068495a49f6442f2ee0f06590c3c0d3fe11915.zip
when demonstrating the correct "double-check" idiom, provide a
reminder that the return value is int...
-rw-r--r--lib/libc/stdio/printf.36
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3
index 370dc48c7b6..8a2a76eebad 100644
--- a/lib/libc/stdio/printf.3
+++ b/lib/libc/stdio/printf.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: printf.3,v 1.67 2014/04/22 15:22:04 sobrado Exp $
+.\" $OpenBSD: printf.3,v 1.68 2014/05/09 05:14:17 deraadt Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -33,7 +33,7 @@
.\"
.\" @(#)printf.3 8.1 (Berkeley) 6/4/93
.\"
-.Dd $Mdocdate: April 22 2014 $
+.Dd $Mdocdate: May 9 2014 $
.Dt PRINTF 3
.Os
.Sh NAME
@@ -871,7 +871,7 @@ for later interpolation by
.Pp
Be sure to use the proper secure idiom:
.Bd -literal -offset indent
-ret = snprintf(buffer, sizeof(buffer), "%s", string);
+int ret = snprintf(buffer, sizeof(buffer), "%s", string);
if (ret == -1 || ret >= sizeof(buffer))
goto toolong;
.Ed