267 output =
lwalloc(maxlength + 4);
271 if (truncdirection == 0)
274 if (endpos - startpos < maxlength)
276 outstart = str + startpos;
277 strncat(output, outstart, endpos - startpos + 1);
284 outstart = str + endpos + 1 - maxlength + 3;
285 strncat(output,
"...", 4);
286 strncat(output, outstart, maxlength - 3);
291 strncat(output,
"...", 4);
297 if (truncdirection == 1)
300 if (endpos - startpos < maxlength)
302 outstart = str + startpos;
303 strncat(output, outstart, endpos - startpos + 1);
310 outstart = str + startpos;
311 strncat(output, outstart, maxlength - 3);
312 strncat(output,
"...", 4);
317 strncat(output,
"...", 4);
void * lwalloc(size_t size)