r2380: nicer error reporting in convert_string()
authorAndrew Tridgell <tridge@samba.org>
Fri, 17 Sep 2004 10:41:53 +0000 (10:41 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:58:46 +0000 (12:58 -0500)
source/lib/charcnv.c

index 2109e957d92d96e08dab14fdcf138cdaac0ef10e..f30f5b92397fd6868a00bb1f120bda57d237ee51 100644 (file)
@@ -161,12 +161,15 @@ ssize_t convert_string(charset_t from, charset_t to,
                                break;
                        case E2BIG:
                                reason="No more room"; 
-                               DEBUG(0, ("convert_string: Required %d, available %d\n",
-                                       srclen, destlen));
-                               /* we are not sure we need srclen bytes,
-                                 may be more, may be less.
-                                 We only know we need more than destlen
-                                 bytes ---simo */
+                               if (from == CH_UNIX) {
+                                       DEBUG(0,("E2BIG: convert_string(%s,%s): srclen=%d destlen=%d - '%s'\n",
+                                                charset_name(from), charset_name(to),
+                                                srclen, destlen, (const char *)src));
+                               } else {
+                                       DEBUG(0,("E2BIG: convert_string(%s,%s): srclen=%d destlen=%d\n",
+                                                charset_name(from), charset_name(to),
+                                                srclen, destlen));
+                               }
                               break;
                        case EILSEQ:
                               reason="Illegal multibyte sequence";