diff options
author | phintuka <phintuka> | 2007-01-20 18:22:33 +0000 |
---|---|---|
committer | phintuka <phintuka> | 2007-01-20 18:22:33 +0000 |
commit | a3367bd7c221289f44e5bb16cb3a000788e3ed39 (patch) | |
tree | 9c39d15a55000b6a6e98cb067a3eb835b09b50fb | |
parent | 33151351ecd3a9078512b91358056f1a0542f052 (diff) | |
download | xineliboutput-a3367bd7c221289f44e5bb16cb3a000788e3ed39.tar.gz xineliboutput-a3367bd7c221289f44e5bb16cb3a000788e3ed39.tar.bz2 |
Check if fopen failed before writing to file (patch from Ville Skyttä)
-rw-r--r-- | frontend.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -4,7 +4,7 @@ * See the main source file 'xineliboutput.c' for copyright information and * how to reach the author. * - * $Id: frontend.c,v 1.27 2007-01-06 04:31:21 phintuka Exp $ + * $Id: frontend.c,v 1.28 2007-01-20 18:22:33 phintuka Exp $ * */ @@ -58,7 +58,9 @@ void cXinelibThread::KeypressHandler(const char *keymap, const char *key, { #ifdef XINELIBOUTPUT_LOG_KEYS static FILE *flog = fopen("/video/keys.log","w"); - fprintf(flog,"KEY %s %s %d %d\n",keymap,key,repeat,release);fflush(flog); + if (flog) { + fprintf(flog,"KEY %s %s %d %d\n",keymap,key,repeat,release); fflush(flog); + } #endif TRACE("keypress_handler: " << (keymap?keymap:"") << " " << key); |