K 10 svn:author V 6 dteske K 8 svn:date V 27 2014-09-29T00:35:12.390411Z K 7 svn:log V 1177 Use snprintf(3) in place of unbounded sprintf(3) (prevent buffer overflow). Use adequately sized buffer for error(s) (512 -> PATH_MAX + 512). Fix the following style(9) nits while here: - distfetch.c uses PATH_MAX while distextract.c uses MAXPATHLEN; standardize on one (PATH_MAX) - Move $FreeBSD$ from comment to __FBSDID() - Sort included headers (alphabetically, sys/* at top) - Add missing header includes (e.g., for getenv(3), calloc(3)/malloc(3)/free(3), and atoi(3); for strdup(3), strrchr(3), strsep(3), and strcmp(3); for isspace(3); and for chdir(2), etc.) - Remove rogue newline at end of distfetch.c - Don't declare variables in if-, while-, or other statement NB: To prevent masking of prior declarations atop function - Perform stack alignment for variable declarations - Add missing function prototype for count_files() in distextract.c - Break out single-line multivariable-declarations NB: Aligning similarly-named variables with one-char difference(s) NB: Minimizes diffs and makes future diffs more clear - Use err(3) family of functions (requires s/int err;/int retval;/g) Reviewed by: nwhitehorn, julian END