[liblouis-liblouisxml] [liblouis] r863 committed - Fix brl_checks.c: inlen should be the exact length of the input text

  • From: liblouis@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Fri, 14 Dec 2012 14:04:11 +0000

Revision: 863
Author:   bertfrees@xxxxxxxxx
Date:     Fri Dec 14 06:03:56 2012
Log: Fix brl_checks.c: inlen should be the exact length of the input text
http://code.google.com/p/liblouis/source/detail?r=863

Modified:
 /trunk/tests/brl_checks.c

=======================================
--- /trunk/tests/brl_checks.c   Fri Dec 14 00:31:25 2012
+++ /trunk/tests/brl_checks.c   Fri Dec 14 06:03:56 2012
@@ -64,8 +64,8 @@

   int expectedlen = strlen(expected);

-  inlen = strlen(str) * 2;
-  outlen = inlen;
+  inlen = strlen(str);
+  outlen = inlen * 2;
   inbuf = malloc(sizeof(widechar) * inlen);
   outbuf = malloc(sizeof(widechar) * outlen);
   if (typeform != NULL)
@@ -73,7 +73,8 @@
       typeformbuf = malloc(outlen);
       memcpy(typeformbuf, typeform, outlen);
     }
-  if (!extParseChars(str, inbuf))
+  inlen = extParseChars(str, inbuf);
+  if (!inlen)
     {
       printf("Cannot parse input string.\n");
       return 1;
@@ -262,8 +263,9 @@
   int rv = 0;

   inlen = strlen(str);
-  inbuf = malloc(sizeof(widechar) * (inlen + 1));
-  if (!extParseChars(str, inbuf))
+  inbuf = malloc(sizeof(widechar) * inlen);
+  inlen = extParseChars(str, inbuf);
+  if (!inlen)
     {
       printf("Cannot parse input string.\n");
       return 1;
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouis] r863 committed - Fix brl_checks.c: inlen should be the exact length of the input text - liblouis