about summary refs log tree commit diff
path: root/iconvdata/tst-table-from.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2002-09-24 04:19:03 +0000
committerUlrich Drepper <drepper@redhat.com>2002-09-24 04:19:03 +0000
commitfa00744e514a99087f5fe70cac9334b29a04c93a (patch)
treeafb188699c7ba3d139c0c1e5962a749bec6480b7 /iconvdata/tst-table-from.c
parentf2a444335f8deabb58145db315b33a87e4f576da (diff)
downloadglibc-fa00744e514a99087f5fe70cac9334b29a04c93a.tar.gz
glibc-fa00744e514a99087f5fe70cac9334b29a04c93a.tar.xz
glibc-fa00744e514a99087f5fe70cac9334b29a04c93a.zip
Update.
	* iconv/iconv_prog.c (main): Provide an error message that identifies
	the wrong encoding.

2002-09-22  Bruno Haible  <bruno@clisp.org>

	* iconvdata/tscii.c: New file.
	* iconvdata/testdata/TSCII: New file.
	* iconvdata/testdata/TSCII..UTF8: New file.
	* iconvdata/TSCII.precomposed: New file.
	* iconvdata/TSCII.irreversible: New file.
	* iconvdata/gconv-modules (TSCII): New module.
	* iconvdata/Makefile (modules): Add TSCII.
	(distribute): Add tscii.c.
	* iconvdata/tst-table-from.c (try, utf8_decode, main): Double output
	buffer size.
	* iconvdata/tst-tables.sh: Add TSCII.
	* iconvdata/TESTS: Add TSCII.

2002-09-22  Bruno Haible  <bruno@clisp.org>

	Revert 2002-04-18 patch.
	* iconvdata/euc-jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for
	FROM_DIRECTION): Make the FROM direction stateful again.
	* iconvdata/shift_jisx0213.c (EMIT_SHIFT_TO_INIT, BODY for
	FROM_DIRECTION): Likewise.

2002-09-22  Bruno Haible  <bruno@clisp.org>
Diffstat (limited to 'iconvdata/tst-table-from.c')
-rw-r--r--iconvdata/tst-table-from.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/iconvdata/tst-table-from.c b/iconvdata/tst-table-from.c
index 084de5fe2b..34ea79362d 100644
--- a/iconvdata/tst-table-from.c
+++ b/iconvdata/tst-table-from.c
@@ -57,7 +57,7 @@ hexbuf (unsigned char buf[], unsigned int buflen)
   return msg;
 }
 
-/* Attempts to convert a byte buffer BUF (BUFLEN bytes) to OUT (6 bytes)
+/* Attempts to convert a byte buffer BUF (BUFLEN bytes) to OUT (12 bytes)
    using the conversion descriptor CD.  Returns the number of written bytes,
    or 0 if ambiguous, or -1 if invalid.  */
 static int
@@ -66,7 +66,7 @@ try (iconv_t cd, unsigned char buf[], unsigned int buflen, unsigned char *out)
   const char *inbuf = (const char *) buf;
   size_t inbytesleft = buflen;
   char *outbuf = (char *) out;
-  size_t outbytesleft = 6;
+  size_t outbytesleft = 12;
   size_t result;
 
   iconv (cd, NULL, NULL, NULL, NULL);
@@ -100,10 +100,10 @@ try (iconv_t cd, unsigned char buf[], unsigned int buflen, unsigned char *out)
 	  fprintf (stderr, "%s: inbytes = %ld, outbytes = %ld\n",
 		   hexbuf (buf, buflen),
 		   (long) (buflen - inbytesleft),
-		   (long) (6 - outbytesleft));
+		   (long) (12 - outbytesleft));
 	  exit (1);
 	}
-      return 6 - outbytesleft;
+      return 12 - outbytesleft;
     }
 }
 
@@ -111,7 +111,7 @@ try (iconv_t cd, unsigned char buf[], unsigned int buflen, unsigned char *out)
 static const char *
 utf8_decode (const unsigned char *out, unsigned int outlen)
 {
-  static char hexbuf[42];
+  static char hexbuf[84];
   char *p = hexbuf;
 
   while (outlen > 0)
@@ -203,7 +203,7 @@ main (int argc, char *argv[])
   search_depth = (strcmp (charset, "UTF-8") == 0 ? 3 : 4);
 
   {
-    unsigned char out[6];
+    unsigned char out[12];
     unsigned char buf[4];
     unsigned int i0, i1, i2, i3;
     int result;