[2/6] libc/iconv: Check ces handlers table value in euc_from_ucs_init

Message ID 20200820221449.686006-3-keithp@keithp.com
State New
Headers show
Series
  • Fixes inspired by building with clang
Related show

Commit Message

R. Diez via Newlib Aug. 20, 2020, 10:14 p.m.
Need to check the value returned from
_iconv_from_ucs_ces_handlers_table.init -- the test was
incorrectly comparing the array holding the value.

Signed-off-by: Keith Packard <keithp@keithp.com>

---
 newlib/libc/iconv/ces/euc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

-- 
2.28.0

Patch

diff --git a/newlib/libc/iconv/ces/euc.c b/newlib/libc/iconv/ces/euc.c
index ebd7091b0..56c0c6a6c 100644
--- a/newlib/libc/iconv/ces/euc.c
+++ b/newlib/libc/iconv/ces/euc.c
@@ -149,7 +149,7 @@  ok:
       data->data[i] = _iconv_from_ucs_ces_handlers_table.init (
                                                         rptr,
                                                         data->desc[i].csname);
-      if (data->data == NULL)
+      if (data->data[i] == NULL)
         goto error;
     }