From 51b2d2caeb46f18f2a6f03f666230d3211951586 Mon Sep 17 00:00:00 2001 From: tomo Date: Fri, 3 Oct 2003 11:45:49 +0000 Subject: [PATCH 1/1] (chise_ccs_decode): Return -1 when argument `ccs' is NULL. (chise_ccs_set_decoded_char): Likewise. --- chise.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/chise.c b/chise.c index 43c60e7..b5ede8a 100644 --- a/chise.c +++ b/chise.c @@ -127,7 +127,7 @@ chise_ds_get_feature (CHISE_DS *ds, const unsigned char *feature) return ft; } -CHISE_CCS_Table* +CHISE_CCS chise_ds_get_ccs (CHISE_DS *ds, const unsigned char *ccs) { CHISE_CCS_Table* ct; @@ -391,6 +391,9 @@ chise_ccs_decode (CHISE_CCS ccs, int code_point) int status = 0; char key_buf[16]; + if (ccs == NULL) + return -1; + if (ccs->db == NULL) { CHISE_DS *ds = ccs->ds; @@ -423,6 +426,9 @@ chise_ccs_set_decoded_char (CHISE_CCS ccs, { char key_buf[16], val_buf[8]; + if (ccs == NULL) + return -1; + if ((ccs->access & DB_CREATE) == 0) { if (ccs->db != NULL) -- 1.7.10.4