Sebastian Lackner sebastian@fds-team.de writes:
BTW: I assume its intentional that you realloc only the first buffer to release some space, right? In the worst case we are wasting up to about PATH_MAX * sizeof(WCHAR) space in the other buffers.
Yes, in the common case it will only waste a few bytes. It's only the last buffer that can have significant space left.