mirror of
https://github.com/tbamud/tbamud.git
synced 2026-03-04 12:00:17 +01:00
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:
parent
b27003e881
commit
3cb8e52043
9 changed files with 204 additions and 62 deletions
11
src/comm.c
11
src/comm.c
|
|
@ -422,7 +422,16 @@ void copyover_recover()
|
|||
|
||||
for (;;) {
|
||||
fOld = TRUE;
|
||||
fscanf (fp, "%d %ld %s %s %s\n", &desc, &pref, name, host, guiopt);
|
||||
if (fscanf(fp, "%d %ld %s %s %s\n", &desc, &pref, name, host, guiopt) != 5) {
|
||||
if(!feof(fp)) {
|
||||
if(ferror(fp))
|
||||
log("SYSERR: error reading copyover file %s: %s", COPYOVER_FILE, strerror(errno));
|
||||
else if(!feof(fp))
|
||||
log("SYSERR: could not scan line in copyover file %s.", COPYOVER_FILE);
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (desc == -1)
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue