Devin Teske 82ac9f2bf7 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., <stdlib.h> for getenv(3),
  calloc(3)/malloc(3)/free(3), and atoi(3); <string.h> for strdup(3),
  strrchr(3), strsep(3), and strcmp(3); <ctype.h> for isspace(3); and
  <unistd.h> 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
2014-09-29 00:35:12 +00:00
..
2013-03-17 06:54:04 +00:00
2013-07-10 07:40:30 +00:00
2014-07-29 19:49:27 +00:00
2014-07-07 00:27:09 +00:00
2014-07-17 06:57:26 +00:00
2012-10-07 19:53:04 +00:00
2014-07-29 19:49:27 +00:00
2014-09-28 11:32:46 +00:00
2014-09-13 18:40:12 +00:00
2014-07-07 00:27:09 +00:00
2014-09-19 23:38:44 +00:00
2013-04-11 18:46:41 +00:00
2012-05-17 11:50:12 +00:00
2014-07-18 06:48:02 +00:00
2014-08-06 22:17:26 +00:00
2014-07-29 19:49:27 +00:00
2013-09-07 20:25:22 +00:00
2014-09-01 16:12:29 +00:00
2014-09-08 09:16:07 +00:00