aboutsummaryrefslogtreecommitdiff
path: root/wcsmbs
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-19 07:26:24 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-19 07:26:24 +0000
commit489926716ccef8d7b42894cfb6af498a3ee0edbc (patch)
tree9f815ec84c21a4151e17a1943b821f70dcf015c8 /wcsmbs
parente20d563dac2de29a8b6823e0030f091737c59911 (diff)
downloadglibc-489926716ccef8d7b42894cfb6af498a3ee0edbc.zip
glibc-489926716ccef8d7b42894cfb6af498a3ee0edbc.tar.gz
glibc-489926716ccef8d7b42894cfb6af498a3ee0edbc.tar.bz2
Compute result correctly for successful call with s == NULL.
Diffstat (limited to 'wcsmbs')
-rw-r--r--wcsmbs/wcrtomb.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wcsmbs/wcrtomb.c b/wcsmbs/wcrtomb.c
index b546c7a..c64c7eb 100644
--- a/wcsmbs/wcrtomb.c
+++ b/wcsmbs/wcrtomb.c
@@ -1,6 +1,6 @@
-/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
- Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
+ Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
@@ -94,7 +94,7 @@ __wcrtomb (char *s, wchar_t wc, mbstate_t *ps)
if (status == GCONV_OK || status == GCONV_EMPTY_INPUT
|| status == GCONV_FULL_OUTPUT)
- result = data.outbuf - (unsigned char *) s;
+ result = data.outbuf - (unsigned char *) (s ?: buf);
else
{
result = (size_t) -1;