If MAXPATHL is 4096 then the stack frame for calling this function will use more than 4k stack space, declaring it as static means it's pre-allocated elsewhere like a global variable but with function-local visibility