280 output =
lwalloc(maxlength + 4);
284 if (truncdirection == 0)
287 if (endpos - startpos < maxlength)
289 outstart =
str + startpos;
290 strncat(output, outstart, endpos - startpos + 1);
297 outstart =
str + endpos + 1 - maxlength + 3;
298 strncat(output,
"...", 4);
299 strncat(output, outstart, maxlength - 3);
304 strncat(output,
"...", 4);
310 if (truncdirection == 1)
313 if (endpos - startpos < maxlength)
315 outstart =
str + startpos;
316 strncat(output, outstart, endpos - startpos + 1);
323 outstart =
str + startpos;
324 strncat(output, outstart, maxlength - 3);
325 strncat(output,
"...", 4);
330 strncat(output,
"...", 4);
void * lwalloc(size_t size)