Using curl 7.19.4
"If copying takes place between objects that overlap as a result of a call to
sprintf() or snprintf(), the results are undefined."
E.g. on line 5290 you have:
sprintf(dirbuildup,"%s%s%s",dirbuildup, DIR_CHAR, tempdir);
cppcheck 1.29 (https://sourceforge.net/projects/cppcheck/) yeilds:
[./src/main.c:5290]: (error) Overlapping data buffer dirbuildup