That was all rather complex.  I would <code>
const int MAX_FRAGMENT = 19;
static const char sep[] = "...";
char abbr[sizeof(sep) + 2 * MAX_FRAGMENT];
const int head = (nl > promiser + MAX_FRAGMENT) ? MAX_FRAGMENT : (nl - promiser);
const char *last_line = strrchr(promiser, '\n') + 1;
assert(last_line); /* not NULL, we know we have at least one '\n' */
int tail = strlen(last_line);
if (tail > MAX_FRAGMENT)
{
   last_line += tail - MAX_FRAGMENT;
}
memcpy(abbr, promiser, head);
strcpy(abbr + head, sep);
strcat(abbr, last_line);
</code>