I did some thinking. How does this look to you guys?

```c
        // new_start_len should be 0 if new_start is NULL, this assertion
        // confirms that (can be removed if we're sure).
        assert(new_start == NULL || new_start_len != 0);

        len = new_start ? strlen(new_start) : 0;
        needed_len += len;
        if (needed_len > new_start_len) {
          new_start_len = needed_len + 50;
          new_start = xrealloc(new_start, new_start_len);
          new_start[len] = NUL;
        }
        new_end = new_start + len;
```

To replace that if/else block.