return 0;
}
char p_string[BUF_SIZE] = {0, };
- i18n_ustring_copy_au_n(p_string, str, BUF_SIZE);
+ i18n_ustring_copy_au_n(p_string, str, BUF_SIZE - 1);
printf(" Convert number : %s\n", p_string);
free(str);
PRINT_ASCIIDOC_LOG("|===\n");
return 0;
}
char p_string[BUF_SIZE];
- i18n_ustring_copy_au_n(p_string, str, BUF_SIZE);
+ i18n_ustring_copy_au_n(p_string, str, BUF_SIZE - 1);
printf(" Convert number : %s\n", p_string);
free(str);
PRINT_ASCIIDOC_LOG("|===\n");
CHECK_ERROR("i18n_plural_rules_select_double", error_code);
char output_buffer[BUF_SIZE] = { 0 };
- i18n_ustring_copy_au_n(output_buffer, buffer, BUF_SIZE);
+ i18n_ustring_copy_au_n(output_buffer, buffer, BUF_SIZE - 1);
printf("Matched rule: %s \n", output_buffer);
/* Release the rules as it is not needed anymore. */
static i18n_udatepg_h dtpg = NULL;
static int ret = I18N_ERROR_NONE;
-#define I18N_ret_LEN 100
+#define I18N_RET_LEN 100
#define SKELETON_LEN 6
#define BEST_PATTERN_CAPACITY 12
const char *b_skeleton = "MMMM";
i18n_uchar skeleton[SKELETON_LEN] = { 0, };
i18n_uchar bskeleton[SKELETON_LEN] = { 0, };
- i18n_uchar best_pattern[I18N_ret_LEN] = { 0, };
+ i18n_uchar best_pattern[I18N_RET_LEN] = { 0, };
int skeleton_len;
int best_pattern_len;
int capacity;
- i18n_ustring_copy_ua(skeleton, a_skeleton);
+ i18n_ustring_copy_ua_n(skeleton, a_skeleton, SKELETON_LEN - 1);
skeleton_len = i18n_ustring_get_length(skeleton);
capacity = (int)(sizeof(best_pattern)/sizeof(best_pattern[0]));
capacity, &best_pattern_len);
assert_eq(ret, I18N_ERROR_NONE);
- i18n_ustring_copy_ua(bskeleton, b_skeleton);
+ i18n_ustring_copy_ua_n(bskeleton, b_skeleton, SKELETON_LEN - 1);
skeleton_len = i18n_ustring_get_length(bskeleton);
capacity = (int)(sizeof(best_pattern)/sizeof(best_pattern[0]));