In newfmt() example one level of indentation is enough.

This commit is contained in:
uwe 2013-01-20 10:57:19 +00:00
parent 85744c86ad
commit dd48d6e3aa
1 changed files with 9 additions and 9 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: printf.3,v 1.59 2013/01/19 15:25:58 uwe Exp $
.\" $NetBSD: printf.3,v 1.60 2013/01/20 10:57:19 uwe Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -772,14 +772,14 @@ To allocate a 128 byte string and print into it:
#include \*[Lt]stdarg.h\*[Gt]
char *newfmt(const char *fmt, ...)
{
char *p;
va_list ap;
if ((p = malloc(128)) == NULL)
return (NULL);
va_start(ap, fmt);
(void) vsnprintf(p, 128, fmt, ap);
va_end(ap);
return (p);
char *p;
va_list ap;
if ((p = malloc(128)) == NULL)
return (NULL);
va_start(ap, fmt);
(void) vsnprintf(p, 128, fmt, ap);
va_end(ap);
return (p);
}
.Ed
.Sh ERRORS