Hi! >> + size_t offset = strlen(tmesg); >> + int size_changed = 0; >> + >> + if ((offset + symb_num * size + 1)>= USERMESG) { >> + size = (USERMESG - offset) / symb_num - end_num - 1; > (USERMESG - offset - sizeof(msg_end)) / symb_num ? Ah, you're right! >> + size_changed = 1; >> + } >> + >> + char *pmesg = tmesg + offset; >> + >> + size_t i; >> + for (i = 0; i< size; ++i) { >> + sprintf(pmesg, " %02x", ((unsigned char *)buf)[i]); >> + pmesg += symb_num; >> + } >> + >> + if (size_changed) >> + strcat(pmesg, msg_end); > Shouldn't strcpy() suffice here? > Yes, changed from tmesg to pmesg, but forgot correct the rest. >> + tst_res(ttype, NULL, "%s", tmesg); >> +}
If tmesg is full it is never going to be printed. tst_res will add at least new line character, header and then message will exceed its size, as a result test will break with error. Is it ok or may be tst_res() function will be changed in the future somehow? Thanks, Alexey ------------------------------------------------------------------------------ Try New Relic Now & We'll Send You this Cool Shirt New Relic is the only SaaS-based application performance monitoring service that delivers powerful full stack analytics. Optimize and monitor your browser, app, & servers with just a few lines of code. Try New Relic and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_may _______________________________________________ Ltp-list mailing list Ltp-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/ltp-list