From 0b90209578eeb8932792b1abcd545f20487be96e Mon Sep 17 00:00:00 2001 From: Benny Prijono Date: Mon, 18 Feb 2008 12:27:47 +0000 Subject: Fixed crash when running SRTP on Win32 app since stderr is undefined (thanks Truong Thanh Quang) git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1804 74dad513-b988-da41-8d7b-12977e46ad98 --- third_party/srtp/crypto/rng/rand_source.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'third_party') diff --git a/third_party/srtp/crypto/rng/rand_source.c b/third_party/srtp/crypto/rng/rand_source.c index 9bd7fc21..9867c295 100644 --- a/third_party/srtp/crypto/rng/rand_source.c +++ b/third_party/srtp/crypto/rng/rand_source.c @@ -97,8 +97,11 @@ rand_source_init(void) { #elif (_MSC_VER >= 1400) dev_random_fdes = RAND_SOURCE_READY; #else - /* no random source available; let the user know */ - fprintf(stderr, "WARNING: no real random source present!\n"); + /* no random source available; let the user know */ + if (stderr) + fprintf(stderr, "WARNING: no real random source present!\n"); + else + printf("WARNING: no real random source present!\n"); dev_random_fdes = RAND_SOURCE_READY; #endif return err_status_ok; -- cgit v1.2.3