Hi!
On 05/20/2013 04:16 PM, [email protected] wrote:
>
>> +
>> + EXPAND_VAR_ARGS(tmesg, arg_fmt, USERMESG);
>> +
>> + static const size_t symb_num = 3; /* space + xx */
>> +
>> + size_t offset = strlen(tmesg);
>> +
>> + if ((offset + symb_num * size + 1)>= USERMESG) {
>> + printf("%s: %i: line too long\n", __func__, __LINE__);
>> + abort();
> What about printing only the start of the buffer as:
>
> 'This is test message: 0x0F 0x04 0x33 0x44 ...'
>
> instead of the abort?
Yes, it's possible. Do I need to calc the header which tst_res() is
going to add or simply print first four bytes and check if it fits the
tmesg?
>> + }
>> +
>> + size_t i;
>> + for (i = 0; i< size; ++i) {
>> + sprintf(tmesg + offset + i * symb_num,
>> + " %02x", (unsigned char)buf[i]);
>> + }
>> +
>> + tst_res(ttype, NULL, "%s", tmesg);
>> +}
Also, I printing buffer without 0x prefix to make it more compact,
should I add it?
------------------------------------------------------------------------------
AlienVault Unified Security Management (USM) platform delivers complete
security visibility with the essential security capabilities. Easily and
efficiently configure, manage, and operate all of your security controls
from a single console and one unified framework. Download a free trial.
http://p.sf.net/sfu/alienvault_d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list