trim.c: avoid zero size xnrealloc memory allocation