diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 15:36:28 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-13 15:36:28 +0300 |
| commit | 3cc28bcfc63369013f8c24a4cf07a13fb54c86dc (patch) | |
| tree | ca8b4734d703a149dba26b1959cfd4cbc49087be | |
| parent | 15314877f2f503c20994bbd1e2bf881f5f2d87a6 (diff) | |
| download | astar-3cc28bcfc63369013f8c24a4cf07a13fb54c86dc.tar.xz | |
Handle an error
| -rw-r--r-- | bmp.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -93,6 +93,10 @@ void map_to_bmp(Map map, size_t map_width, size_t map_height, Position start, Po FILE *fout = fopen(filename, "wb"); + if (fout == NULL) { + message(height, "Couldn't open %s for writing", filename); + return; + } fwrite(header, 1, 54, fout); fwrite((char*)buf, 1, imagesize, fout); fclose(fout); |
