diff options
author | Michael Snyder <msnyder@vmware.com> | 2010-05-13 23:53:32 +0000 |
---|---|---|
committer | Michael Snyder <msnyder@vmware.com> | 2010-05-13 23:53:32 +0000 |
commit | c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531 (patch) | |
tree | 296c321c47907882ffc668af19edd04ec67851c3 /gdb/charset.c | |
parent | cc59ec59c88e97e6e674db776fed9b197dffce33 (diff) | |
download | gdb-c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531.zip gdb-c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531.tar.gz gdb-c5504eafbce9ab0ea4d9aa7f222d7b75a6c77531.tar.bz2 |
2010-05-13 Michael Snyder <msnyder@vmware.com>
* charset.c: White space.
* c-lang.c: White space.
* cli-out.c: White space.
* coffread.c: White space.
* complaints.c: White space.
* completer.c: White space.
* corefile.c: White space.
* corelow.c: White space.
* cp-abi.c: White space.
* cp-namespace.c: White space.
* cp-support.c: White space.
* cp-valprint.c: White space.
* c-typeprint.c: White space.
* c-valprint.c: White space.
Diffstat (limited to 'gdb/charset.c')
-rw-r--r-- | gdb/charset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/charset.c b/gdb/charset.c index fadd232..8a9b5ad 100644 --- a/gdb/charset.c +++ b/gdb/charset.c @@ -167,6 +167,7 @@ iconv (iconv_t utf_flag, const char **inbuf, size_t *inbytesleft, /* In all other cases we simply copy input bytes to the output. */ size_t amt = *inbytesleft; + if (amt > *outbytesleft) amt = *outbytesleft; memcpy (*outbuf, *inbuf, amt); @@ -312,6 +313,7 @@ validate (struct gdbarch *gdbarch) const char *host_cset = host_charset (); const char *target_cset = target_charset (gdbarch); const char *target_wide_cset = target_wide_charset_name; + if (!strcmp (target_wide_cset, "auto")) target_wide_cset = gdbarch_auto_wide_charset (gdbarch); @@ -634,10 +636,10 @@ wchar_iterate (struct wchar_iterator *iter, size_t orig_in = iter->bytes; size_t out_avail = out_request * sizeof (gdb_wchar_t); size_t num; - size_t r = iconv (iter->desc, (ICONV_CONST char **) &iter->input, &iter->bytes, &outptr, &out_avail); + if (r == (size_t) -1) { switch (errno) |