[
https://issues.apache.org/jira/browse/HTRACE-224?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14700270#comment-14700270
]
Abraham Elmahrek edited comment on HTRACE-224 at 8/17/15 9:37 PM:
------------------------------------------------------------------
# htrace-c/src/core/conf.c#L181 - I think the logic might be wrong.
{code}
if (!((c != ' ') || (c != '\t'))) {
htrace_log(log, "error parsing %s for %s: garbage at end "
"of string.\n", in, key);
return 0;
}
{code}
It seems to be that the following will always be false since only 1 of the
subexpressions can ever be true.
{code}
!((c != ' ') || (c != '\t'))
{code}
# htrace-c/src/core/conf.c#L232 - I think the logic might be wrong.
{code}
if (!((c == ' ') || (c != '\t'))) {
htrace_log(log, "error parsing %s for %s: garbage at end "
"of string.\n", in, key);
return 0;
}
{code}
It seems to be that the following will be true only when c = '\t'.
{code}
!((c == ' ') || (c != '\t'))
{code}
This means that c == ' ' is not a useful comparison.
was (Author: abec):
# htrace-c/src/core/conf.c#L181 - I think the logic might be wrong.
{code}
if (!((c != ' ') || (c != '\t'))) {
htrace_log(log, "error parsing %s for %s: garbage at end "
"of string.\n", in, key);
return 0;
}
{code}
It seems to be that the following will always be false since only 1 of the
subexpressions can ever be true.
{code}
!((c != ' ') || (c != '\t'))
{code}
# htrace-c/src/core/conf.c#L232 - I think the logic might be wrong.
{code}
if (!((c == ' ') || (c != '\t'))) {
htrace_log(log, "error parsing %s for %s: garbage at end "
"of string.\n", in, key);
return 0;
}
{code}
It seems to be that the following will be true only when c = '\t'.
{code}
!((c == ' ') || (c != '\t'))
{code}
This means that c == ' ' is not a useful comparison.
> htrace C client: htrace_conf_get_u64, htrace_conf_get_double can't handle
> spaces at the end of strings
> ------------------------------------------------------------------------------------------------------
>
> Key: HTRACE-224
> URL: https://issues.apache.org/jira/browse/HTRACE-224
> Project: HTrace
> Issue Type: Bug
> Affects Versions: 3.2.0
> Reporter: Colin Patrick McCabe
> Assignee: Colin Patrick McCabe
> Attachments: HTRACE-224.001.patch
>
>
> htrace C client: htrace_conf_get_u64, htrace_conf_get_double can't handle
> spaces at the end of strings. It should ignore the whitespace, but instead
> it treats it as an error.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)