Skip to content
Snippets Groups Projects
Commit 2368c7b0 authored by Thomas Jahns's avatar Thomas Jahns :cartwheel:
Browse files

Use tighter specification of buffer size.

parent 052fac5c
No related branches found
No related tags found
No related merge requests found
......@@ -154,10 +154,12 @@ print_miss_msg(Xt_idxlist dst_idxlist, int missing_pos,
{
Xt_int missing_index;
xt_idxlist_get_index_at_position(dst_idxlist, missing_pos, &missing_index);
char error_message[1024];
sprintf(error_message, "ERROR: destination intersections do not match "
"with destination index list (first missing index %lld "
"at position %d)", (long long)missing_index, missing_pos);
static const char fmt[] = "ERROR: destination intersections do not match "
"with destination index list (first missing index %lld "
"at position %d)";
char error_message[sizeof (fmt)
+ (sizeof (long long) + sizeof (int)) * CHAR_BIT / 8 * 3];
sprintf(error_message, fmt, (long long)missing_index, missing_pos);
Xt_abort(comm, error_message, source, line);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment