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:
Gehad elrobey 2014-06-08 07:35:20 +03:00 committed by Dirk Hohndel
parent d209d35f64
commit 4a69dea972
2 changed files with 4 additions and 4 deletions

View file

@ -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);

View file

@ -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);