X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/form?a=blobdiff_plain;f=src%2Fwincontrol.c;h=c88c56b8bd5f075e4008acc907eeea40ef7b302e;hb=140cadf8f8dc73a1756169dbfa7cb5f05e3b8b8c;hp=a9f8017f6a3ffb5fc2b75d08b888d37437105994;hpb=b66d0aa40912f26e80a61837cad2b5c743bf4d40;p=plomrogue diff --git a/src/wincontrol.c b/src/wincontrol.c index a9f8017..c88c56b 100644 --- a/src/wincontrol.c +++ b/src/wincontrol.c @@ -4,7 +4,6 @@ #include /* for free() */ #include /* for strlen(), strchr(), strstr() */ #include /* for uint8_t, uint16_t */ -#include /* for fwrite() */ #include /* for access(), unlink() */ #include "windows.h" /* for suspend_win(), append_win(), reset_pad_offset(), * resize_active_win(), init_win(), free_win(), @@ -13,7 +12,7 @@ #include "yx_uint16.h" /* for yx_uint16 struct */ #include "main.h" /* for Wins struct */ #include "readwrite.h" /* for get_linemax(), try_fopen(), try_fclose(), - * try_fgets(), try_fclose_unlink_rename() + * try_fgets(), try_fclose_unlink_rename(), try_fwrite() */ #include "rexit.h" /* for exit_err() */ #include "main.h" /* for World, Wins structs */ @@ -158,13 +157,13 @@ extern void save_win_config(struct World * world, char id) } char line[size]; sprintf(line, "%s\n", wc->title); - fwrite(line, sizeof(char), strlen(line), file); + try_fwrite(line, sizeof(char), strlen(line), file, world, f_name); sprintf(line, "%c\n", wc->draw); - fwrite(line, sizeof(char), strlen(line), file); + try_fwrite(line, sizeof(char), strlen(line), file, world, f_name); sprintf(line, "%d\n", wc->height); - fwrite(line, sizeof(char), strlen(line), file); + try_fwrite(line, sizeof(char), strlen(line), file, world, f_name); sprintf(line, "%d\n", wc->width); - fwrite(line, sizeof(char), strlen(line), file); + try_fwrite(line, sizeof(char), strlen(line), file, world, f_name); char * path = string_prefixed_id(world, "config/windows/Win_", id); try_fclose_unlink_rename(file, path_tmp, path, world, f_name); @@ -432,7 +431,7 @@ extern void save_win_configs(struct World * world) i++; } line[i] = '\n'; - fwrite(line, sizeof(char), strlen(line), file); + try_fwrite(line, sizeof(char), strlen(line), file, world, f_name); try_fclose_unlink_rename(file, path_tmp, path, world, f_name); }