Commit b8bae841 authored by Kristof Szabados's avatar Kristof Szabados
Browse files

lets not keep the user guessing


Signed-off-by: Kristof Szabados's avatarkristof <Kristof.Szabados@ericsson.com>
parent a99323d0
......@@ -323,10 +323,15 @@ BITSTRING int2bit(const INTEGER& value, int length)
tmp_value >>= 1;
}
if (tmp_value != 0) {
int i = 0;
while(tmp_value != 0) {
tmp_value >>= 1;
i++;
}
char *value_str = value.get_val().as_string(); // not tmp_value!
TTCN_error("The first argument of function int2bit(), which is %s, "
"does not fit in %d bit%s.", value_str, length,
length > 1 ? "s" :"");
"does not fit in %d bit%s, needs at least %d.", value_str, length,
length > 1 ? "s" :"", length + i);
Free(value_str);
}
return ret_val;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment