Paths can in principle be longer then PATH_MAX, so simply allocate the buffer with malloc(). CID #1237773