summaryrefslogtreecommitdiff
path: root/base/sfxcommon.c
diff options
context:
space:
mode:
Diffstat (limited to 'base/sfxcommon.c')
-rw-r--r--base/sfxcommon.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/base/sfxcommon.c b/base/sfxcommon.c
index cec104df8..5177a62b6 100644
--- a/base/sfxcommon.c
+++ b/base/sfxcommon.c
@@ -23,6 +23,7 @@
#include "gp.h"
#include "gserrors.h"
#include "stream.h"
+#include "assert_.h"
#define DEFAULT_BUFFER_SIZE 2048
const uint file_default_buffer_size = DEFAULT_BUFFER_SIZE;
@@ -66,6 +67,14 @@ file_open_stream(const char *fname, uint len, const char *file_access,
FILE *file;
char fmode[4]; /* r/w/a, [+], [b], null */
+#ifdef DEBUG
+ if (strlen(gp_fmode_binary_suffix) > 0) {
+ if (strchr(file_access, gp_fmode_binary_suffix[0]) != NULL)
+ dmprintf(mem, "\nWarning: spurious 'b' character in file access mode\n");
+ assert(strchr(file_access, gp_fmode_binary_suffix[0]) == NULL);
+ }
+#endif
+
if (!iodev)
iodev = iodev_default(mem);
code = file_prepare_stream(fname, len, file_access, buffer_size, ps, fmode, mem);