Use result buffer of localtime_r, it's less confusing
Later versions of GCC complain that the value of ftruncate is unused

Why? Because GCC is fucking retarded.