diff options
| author | John Kohl <jtkohl@mit.edu> | 1990-05-02 22:29:22 +0000 |
|---|---|---|
| committer | John Kohl <jtkohl@mit.edu> | 1990-05-02 22:29:22 +0000 |
| commit | bc7186cc312ebf7a7f02e2e3c606d623b34bb8b8 (patch) | |
| tree | c9b17a362aee4f8ebdbd357fe7a1d71b078494e5 /src | |
| parent | bb6c12a98299846c8abb7c7d4b2eaded25b1e3a6 (diff) | |
| download | krb5-bc7186cc312ebf7a7f02e2e3c606d623b34bb8b8.tar.gz krb5-bc7186cc312ebf7a7f02e2e3c606d623b34bb8b8.tar.xz krb5-bc7186cc312ebf7a7f02e2e3c606d623b34bb8b8.zip | |
Initial revision
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@687 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/krb5/posix/vfprintf.c | 47 | ||||
| -rw-r--r-- | src/lib/krb5/posix/vsprintf.c | 39 |
2 files changed, 86 insertions, 0 deletions
diff --git a/src/lib/krb5/posix/vfprintf.c b/src/lib/krb5/posix/vfprintf.c new file mode 100644 index 000000000..94f0fb582 --- /dev/null +++ b/src/lib/krb5/posix/vfprintf.c @@ -0,0 +1,47 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vfprintf.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include <stdio.h> +#include <varargs.h> + +int +vfprintf(iop, fmt, ap) + FILE *iop; + char *fmt; + va_list ap; +{ + int len; + char localbuf[BUFSIZ]; + + if (iop->_flag & _IONBF) { + iop->_flag &= ~_IONBF; + iop->_ptr = iop->_base = localbuf; + len = _doprnt(fmt, ap, iop); + (void) fflush(iop); + iop->_flag |= _IONBF; + iop->_base = NULL; + iop->_bufsiz = 0; + iop->_cnt = 0; + } else + len = _doprnt(fmt, ap, iop); + + return (ferror(iop) ? EOF : len); +} diff --git a/src/lib/krb5/posix/vsprintf.c b/src/lib/krb5/posix/vsprintf.c new file mode 100644 index 000000000..7f43f9066 --- /dev/null +++ b/src/lib/krb5/posix/vsprintf.c @@ -0,0 +1,39 @@ +/* + * Copyright (c) 1988 Regents of the University of California. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that the above copyright notice and this paragraph are + * duplicated in all such forms and that any documentation, + * advertising materials, and other materials related to such + * distribution and use acknowledge that the software was developed + * by the University of California, Berkeley. The name of the + * University may not be used to endorse or promote products derived + * from this software without specific prior written permission. + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +#if defined(LIBC_SCCS) && !defined(lint) +static char sccsid[] = "@(#)vsprintf.c 5.2 (Berkeley) 6/27/88"; +#endif /* LIBC_SCCS and not lint */ + +#include <stdio.h> +#include <varargs.h> + +int +vsprintf(str, fmt, ap) + char *str, *fmt; + va_list ap; +{ + FILE f; + int len; + + f._flag = _IOWRT+_IOSTRG; + f._ptr = str; + f._cnt = 32767; + len = _doprnt(fmt, ap, &f); + *f._ptr = 0; + return (len); +} |
