diff options
author | Ulrich Drepper <drepper@redhat.com> | 2005-07-20 17:51:14 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2005-07-20 17:51:14 +0000 |
commit | 8a259a2310d269a86c603262e8f2c5f69f2a9c9d (patch) | |
tree | e2718944bb69323ba381e1d80160e490e7b8167c /stdio-common | |
parent | * wcsmbs/bits/wchar2.h: Add definitions for wcrtomb, mbsrtowcs, (diff) | |
download | glibc-8a259a2310d269a86c603262e8f2c5f69f2a9c9d.tar.gz glibc-8a259a2310d269a86c603262e8f2c5f69f2a9c9d.tar.bz2 glibc-8a259a2310d269a86c603262e8f2c5f69f2a9c9d.zip |
* include/stdio.h (__fxprintf): Remove wfmt argument.
* stdio-common/fxprintf.c: Include assert.h, ctype.h and wchar.h.
(__fxprintf): Remove wfmt argument, create wfmt format string on
the fly from fmt.
* argp/argp-fmtstream.c: Adjust all __fxprintf callers.
* argp/argp-help.c: Likewise.
* assert/assert-perr.c: Likewise.
* assert/assert.c: Likewise.
* gmon/gmon.c: Likewise.
* inet/rcmd.c: Likewise.
* malloc/obstack.c: Likewise.
* misc/error.c: Likewise.
* misc/getpass.c: Likewise.
* posix/getopt.c: Likewise.
* resolv/res_hconf.c: Likewise.
* stdio-common/perror.c: Likewise.
* stdio-common/psignal.c: Likewise.
* stdlib/fmtmsg.c: Likewise.
* sunrpc/auth_unix.c: Likewise.
* sunrpc/clnt_perr.c: Likewise.
* sunrpc/clnt_tcp.c: Likewise.
* sunrpc/clnt_udp.c: Likewise.
* sunrpc/clnt_unix.c: Likewise.
* sunrpc/svc_simple.c: Likewise.
* sunrpc/svc_tcp.c: Likewise.
* sunrpc/svc_udp.c: Likewise.
* sunrpc/svc_unix.c: Likewise.
* sunrpc/xdr.c: Likewise.
* sunrpc/xdr_array.c: Likewise.
* sunrpc/xdr_rec.c: Likewise.
* sunrpc/xdr_ref.c: Likewise.
* sysdeps/generic/wordexp.c: Likewise.
Diffstat (limited to 'stdio-common')
-rw-r--r-- | stdio-common/fxprintf.c | 18 | ||||
-rw-r--r-- | stdio-common/perror.c | 2 | ||||
-rw-r--r-- | stdio-common/psignal.c | 7 |
3 files changed, 19 insertions, 8 deletions
diff --git a/stdio-common/fxprintf.c b/stdio-common/fxprintf.c index 82a2ac8bd7..298e5f22b0 100644 --- a/stdio-common/fxprintf.c +++ b/stdio-common/fxprintf.c @@ -17,22 +17,34 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include <assert.h> +#include <ctype.h> #include <stdarg.h> #include <stdio.h> +#include <wchar.h> int -__fxprintf (FILE *fp, const char *fmt, const wchar_t *wfmt, ...) +__fxprintf (FILE *fp, const char *fmt, ...) { if (fp == NULL) fp = stderr; va_list ap; - va_start (ap, wfmt); + va_start (ap, fmt); int res; if (_IO_fwide (fp, 0) > 0) - res = __vfwprintf (fp, wfmt, ap); + { + size_t len = strlen (fmt) + 1, i; + wchar_t wfmt[len]; + for (i = 0; i < len; ++i) + { + assert (isascii (fmt[i])); + wfmt[i] = fmt[i]; + } + res = __vfwprintf (fp, wfmt, ap); + } else res = _IO_vfprintf (fp, fmt, ap); diff --git a/stdio-common/perror.c b/stdio-common/perror.c index 6d32e6d6e1..3ee61520f4 100644 --- a/stdio-common/perror.c +++ b/stdio-common/perror.c @@ -37,7 +37,7 @@ perror_internal (FILE *fp, const char *s, int errnum) errstring = __strerror_r (errnum, buf, sizeof buf); - (void) __fxprintf (fp, "%s%s%s\n", L"%s%s%s\n", s, colon, errstring); + (void) __fxprintf (fp, "%s%s%s\n", s, colon, errstring); } diff --git a/stdio-common/psignal.c b/stdio-common/psignal.c index 6c4e823b91..be95095350 100644 --- a/stdio-common/psignal.c +++ b/stdio-common/psignal.c @@ -47,17 +47,16 @@ psignal (int sig, const char *s) colon = ": "; if (sig >= 0 && sig < NSIG && (desc = INTUSE(_sys_siglist)[sig]) != NULL) - (void) __fxprintf (NULL, L"%s%s%s\n", "%s%s%s\n", s, colon, _(desc)); + (void) __fxprintf (NULL, "%s%s%s\n", s, colon, _(desc)); else { char *buf; if (__asprintf (&buf, _("%s%sUnknown signal %d\n"), s, colon, sig) < 0) - (void) __fxprintf (NULL, "%s%s%s\n", L"%s%s%s\n", - s, colon, _("Unknown signal")); + (void) __fxprintf (NULL, "%s%s%s\n", s, colon, _("Unknown signal")); else { - (void) __fxprintf (NULL, L"%s", "%s", buf); + (void) __fxprintf (NULL, "%s", buf); free (buf); } |