mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 19:13:24 +00:00
HTML: Report saving to file errors.
Use subsurface report_error function in save-html and worldmap-save instead of the ridiculous print to standard output. Also use subsurface_fopen for the sake of different platforms. Signed-off-by: Gehad elrobey <gehadelrobey@gmail.com> Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d209d35f64
commit
4a69dea972
2 changed files with 4 additions and 4 deletions
|
@ -191,9 +191,9 @@ void export_HTML(const char *file_name, const bool selected_only)
|
|||
struct membuffer buf = { 0 };
|
||||
export_list(&buf, selected_only);
|
||||
|
||||
f = fopen(file_name, "w+");
|
||||
f = subsurface_fopen(file_name, "w+");
|
||||
if (!f)
|
||||
printf("error"); /*report error*/
|
||||
report_error(translate("gettextFromC", "Can't open file %s"), file_name);
|
||||
|
||||
flush_buffer(&buf, f); /*check for writing errors? */
|
||||
free_buffer(&buf);
|
||||
|
|
|
@ -90,9 +90,9 @@ void export_worldmap_HTML(const char *file_name, const bool selected_only)
|
|||
struct membuffer buf = { 0 };
|
||||
export(&buf, selected_only);
|
||||
|
||||
f = fopen(file_name, "w+");
|
||||
f = subsurface_fopen(file_name, "w+");
|
||||
if (!f)
|
||||
printf("error"); /*report error*/
|
||||
report_error(translate("gettextFromC", "Can't open file %s"), file_name);
|
||||
|
||||
flush_buffer(&buf, f); /*check for writing errors? */
|
||||
free_buffer(&buf);
|
||||
|
|
Loading…
Add table
Reference in a new issue