When snprintf does not output its entire string because 'n' has been reached, the code continues like nothing has gone wrong. This usually results in the code getting caught in a loop attempting to rename a file (it attempts to append 2, gets the same string back because it was truncated, attempts to append 3, gets the same string back...). There are likely many better fixes than the one I've attached (it also bumps the max length to match what linux uses internally, this is completely for my own benefit, and can be removed)
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Bugs"
simple fix