mirror of
https://github.com/tbamud/tbamud.git
synced 2026-02-22 03:21:45 +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:
@@ -1089,7 +1089,14 @@ static int read_type_list(FILE *shop_f, struct shop_buy_data *list,
|
||||
return (read_list(shop_f, list, 0, max, LIST_TRADE));
|
||||
|
||||
do {
|
||||
fgets(buf, sizeof(buf), shop_f);
|
||||
if (fgets(buf, sizeof(buf), shop_f) == NULL) {
|
||||
if (feof(shop_f))
|
||||
log("SYSERR: unexpected end of file reading shop file type list.");
|
||||
else if (ferror(shop_f))
|
||||
log("SYSERR: error reading reading shop file type list: %s", strerror(errno));
|
||||
else
|
||||
log("SYSERR: error reading reading shop file type list.");
|
||||
}
|
||||
if ((ptr = strchr(buf, ';')) != NULL)
|
||||
*ptr = '\0';
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user