summaryrefslogtreecommitdiff
path: root/src/strgen
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2013-11-23 13:15:07 +0000
committerrubidium <rubidium@openttd.org>2013-11-23 13:15:07 +0000
commit0e9c9921040a1d0e2aa4b820b20535f40a0d75a3 (patch)
tree6dd17568acbfb75610e9b4e248436426ead79e89 /src/strgen
parentb3e93d65208f74802595b12e682d98a4d534a328 (diff)
downloadopenttd-0e9c9921040a1d0e2aa4b820b20535f40a0d75a3.tar.xz
(svn r26058) -Fix: handle the return value of a number of functions better
Diffstat (limited to 'src/strgen')
-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
}