Fix error in "last all" command and several -Wunused-result compiler errors (#55)

* Add build generated files to .gitignore

* Fix error in "last all" output and resolve Wunused-result warnings

- Check return value of several standard library calls that could
return error states.
- Fix issue with "last all" command (it sent tabs for alignment
that were reinterpreted as colors).

* Fix buffer overflow in do_export_zone command
This commit is contained in:
Kevin Fischer
2018-07-21 18:37:18 -05:00
committed by wyld-sw
parent b27003e881
commit 3cb8e52043
9 changed files with 204 additions and 62 deletions

View File

@@ -366,13 +366,13 @@ ACMD(do_export_zone)
f = fix_filename(zone_name);
/* Remove the old copy. */
snprintf(sysbuf, MAX_STRING_LENGTH, "rm %s%s.tar.gz", path, f);
snprintf(sysbuf, MAX_INPUT_LENGTH, "rm %s%s.tar.gz", path, f);
/* Tar the new copy. */
snprintf(sysbuf, MAX_STRING_LENGTH, "tar -cf %s%s.tar %sqq.info %sqq.wld %sqq.zon %sqq.mob %sqq.obj %sqq.trg %sqq.shp", path, f, path, path, path, path, path, path, path);
snprintf(sysbuf, MAX_INPUT_LENGTH, "tar -cf %s%s.tar %sqq.info %sqq.wld %sqq.zon %sqq.mob %sqq.obj %sqq.trg %sqq.shp", path, f, path, path, path, path, path, path, path);
/* Gzip it. */
snprintf(sysbuf, MAX_STRING_LENGTH, "gzip %s%s.tar", path, f);
snprintf(sysbuf, MAX_INPUT_LENGTH, "gzip %s%s.tar", path, f);
send_to_char(ch, "Files tar'ed to \"%s%s.tar.gz\"\r\n", path, f);
}