summaryrefslogtreecommitdiff
path: root/src/strgen/strgen.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/strgen/strgen.cpp')
-rw-r--r--src/strgen/strgen.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/strgen/strgen.cpp b/src/strgen/strgen.cpp
index 01eaed4cb..5d0453841 100644
--- a/src/strgen/strgen.cpp
+++ b/src/strgen/strgen.cpp
@@ -353,7 +353,9 @@ struct LanguageFileWriter : LanguageWriter, FileWriter {
void Finalise()
{
- fputc(0, this->fh);
+ if (fputc(0, this->fh) == EOF) {
+ error("Could not write to %s", this->filename);
+ }
this->FileWriter::Finalise();
}
@@ -368,10 +370,12 @@ struct LanguageFileWriter : LanguageWriter, FileWriter {
/** Multi-OS mkdirectory function */
static inline void ottd_mkdir(const char *directory)
{
+ /* Ignore directory creation errors; they'll surface later on, and most
+ * of the time they are 'directory already exists' errors anyhow. */
#if defined(WIN32) || defined(__WATCOMC__)
- mkdir(directory);
+ mkdir(directory);
#else
- mkdir(directory, 0755);
+ mkdir(directory, 0755);
#endif
}