fix potential buffer overflow in off-by-one bounds checking error

closes #3635

--HG--
branch : HEAD
increase string size by one byte to accomodate the terminating null character in fscanf() since the maximum field width does not include it

closes #3636

hat tip: Will Fiveash

--HG--
branch : HEAD
use of sscanf() had undefined behavior, replace with simple parsing instead

see #3636

--HG--
branch : HEAD
use mkdtemp() to create temporary directory rather than mktemp() followed by mkdir()

closes #3637

--HG--
branch : HEAD