Add protection on path length

- Restrict path length in regard to log buffer size
- printf precision is an int not a size_t, thus limit it to INT_MAX