sd: remove 'ssd' driver support
[unleashed/tickless.git] / usr / src / lib / libwrap / percent_m.c
blob08e49c822549a25f1061c94190a7f2e6ef787a85
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 static char sccsid[] = "@(#) percent_m.c 1.1 94/12/28 17:42:37";
13 #include <stdio.h>
14 #include <errno.h>
15 #include <string.h>
17 extern int errno;
19 #include "mystdarg.h"
21 char *percent_m(obuf, ibuf)
22 char *obuf;
23 char *ibuf;
25 char *bp = obuf;
26 char *cp = ibuf;
28 while (*bp = *cp)
29 if (*cp == '%' && cp[1] == 'm') {
30 strcpy(bp, strerror(errno));
31 bp += strlen(bp);
32 cp += 2;
33 } else {
34 bp++, cp++;
36 return (obuf);