summaryrefslogtreecommitdiffstats
path: root/newlib/libc/stdio/local.h
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/local.h')
-rw-r--r--newlib/libc/stdio/local.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/newlib/libc/stdio/local.h b/newlib/libc/stdio/local.h
index e3d5da573..e62f3418d 100644
--- a/newlib/libc/stdio/local.h
+++ b/newlib/libc/stdio/local.h
@@ -48,11 +48,11 @@ extern int _EXFUN(__srefill,(FILE *fp));
/* Called by the main entry point fns to ensure stdio has been initialized. */
#define CHECK_INIT(fp) \
- do \
- { \
- if (!_REENT->__sdidinit) \
- __sinit (_REENT); \
- } \
+ do \
+ { \
+ if (_REENT && !_REENT->__sdidinit) \
+ __sinit (_REENT); \
+ } \
while (0)
/* Return true iff the given FILE cannot be written now. */