274 output =
lwalloc(maxlength + 4);
278 if (truncdirection == 0)
281 if (endpos - startpos < maxlength)
283 outstart =
str + startpos;
284 strncat(output, outstart, endpos - startpos + 1);
291 outstart =
str + endpos + 1 - maxlength + 3;
292 strncat(output,
"...", 4);
293 strncat(output, outstart, maxlength - 3);
298 strncat(output,
"...", 4);
304 if (truncdirection == 1)
307 if (endpos - startpos < maxlength)
309 outstart =
str + startpos;
310 strncat(output, outstart, endpos - startpos + 1);
317 outstart =
str + startpos;
318 strncat(output, outstart, maxlength - 3);
319 strncat(output,
"...", 4);
324 strncat(output,
"...", 4);
void * lwalloc(size_t size)