Skip to content
This repository has been archived by the owner on Jun 27, 2019. It is now read-only.

Commit

Permalink
flow: Fix error message on icu string replace code
Browse files Browse the repository at this point in the history
'Uchar' was being used when 'char *' was expected.

Signed-off-by: Murilo Belluzzo <murilo.belluzzo@intel.com>
  • Loading branch information
mbelluzzo-intel committed Sep 25, 2015
1 parent 6ed9ec1 commit 0a48771
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
8 changes: 6 additions & 2 deletions src/modules/flow/string/string-icu.c
Original file line number Diff line number Diff line change
Expand Up @@ -976,9 +976,13 @@ string_replace_do(struct string_replace_data *mdata,
}

if (!mdata->forward_on_no_match && !replaced) {
char *from;
r = utf8_from_icu_str_slice(mdata->from_string, -1, &from, &err);
SOL_INT_CHECK(r, < 0, r);

sol_flow_send_error_packet(mdata->node, EINVAL,
"Fail on matching '%s' on string"
" %s", mdata->from_string, mdata->orig_string);
"Fail on matching '%s' on string" " %s", from, value);
free(from);
free(orig_string_replaced);
return -EINVAL;
}
Expand Down
2 changes: 1 addition & 1 deletion src/test-fbp/string-icu-replace.fbp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ out_07 OUT -> IN[1] cmp_07
cmp_07 EQUAL -> RESULT test_07(test/result)

sample_08(constant/string:value="whatever")
out_08(constant/string:value="Fail on matching 'n' on string w")
out_08(constant/string:value="Fail on matching 'no_match' on string whatever")

sample_08 OUT -> IN replace_08(string/replace:from_string="no_match",to_string="★",forward_on_no_match=false)
replace_08 ERROR -> IN _(converter/error) MESSAGE -> IN[0] cmp_08(string/compare)
Expand Down

0 comments on commit 0a48771

Please sign in to comment.