Are you trying to get HOME of current user? If so, why not use `getenv("HOME")`?