summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2000-01-12 00:42:47 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2000-01-12 00:42:47 +0000
commit5c3685fbee3bd6edd7c175ddde143036dd846c3f (patch)
tree99f90e94456be59f79ddb0eb6647f6e89c8e1c45 /lib
parentb509df6a3fd545784c182fcbac71345723ee047c (diff)
indent the source right
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/stdio/printf.323
1 files changed, 12 insertions, 11 deletions
diff --git a/lib/libc/stdio/printf.3 b/lib/libc/stdio/printf.3
index aabe4fdb8bc..a214650bd09 100644
--- a/lib/libc/stdio/printf.3
+++ b/lib/libc/stdio/printf.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: printf.3,v 1.21 1999/09/22 10:05:25 espie Exp $
+.\" $OpenBSD: printf.3,v 1.22 2000/01/12 00:42:46 deraadt Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -574,7 +574,7 @@ are pointers to strings:
#include <stdio.h>
fprintf(stdout, "%s, %s %d, %.2d:%.2d\en",
- weekday, month, day, hour, min);
+ weekday, month, day, hour, min);
.Ed
.Pp
To print \*(Pi
@@ -592,17 +592,18 @@ To allocate a 128 byte string and print into it:
#include <stdlib.h>
#include <stdarg.h>
-char *newfmt(const char *fmt, ...)
+char *
+newfmt(const char *fmt, ...)
{
- char *p;
- va_list ap;
+ 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);
+ if ((p = malloc(128)) == NULL)
+ return (NULL);
+ va_start(ap, fmt);
+ (void) vsnprintf(p, 128, fmt, ap);
+ va_end(ap);
+ return (p);
}
.Ed
.Sh SEE ALSO