s/strndup/xstrndup/ - check memory allocations for failure.