8322 nl: misleading-indentation
[unleashed/tickless.git] / usr / src / lib / libwrap / percent_m.c
blobc509a01523c44fa4063d6c2dd96cc8000661e59f
1 /*
2 * Copyright 2001 Sun Microsystems, Inc. All rights reserved.
3 * Use is subject to license terms.
4 */
5 /*
6 * Replace %m by system error message.
7 *
8 * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
9 */
11 #ifndef lint
12 static char sccsid[] = "@(#) percent_m.c 1.1 94/12/28 17:42:37";
13 #endif
15 #include <stdio.h>
16 #include <errno.h>
17 #include <string.h>
19 extern int errno;
21 #include "mystdarg.h"
23 char *percent_m(obuf, ibuf)
24 char *obuf;
25 char *ibuf;
27 char *bp = obuf;
28 char *cp = ibuf;
30 while (*bp = *cp)
31 if (*cp == '%' && cp[1] == 'm') {
32 strcpy(bp, strerror(errno));
33 bp += strlen(bp);
34 cp += 2;
35 } else {
36 bp++, cp++;
38 return (obuf);