From 27340d85d20d38d70f792b578fffb8b4c8cc3328 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 9 May 2011 13:55:12 +0000 Subject: [PATCH] 2011-05-09 15:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/net.c ! NETNAME(): fixed potential GPF on linux/watcom builds ! HB_USERNAME(): fixed potential GPF on *nix and os2 builds ; Pls chk me --- harbour/ChangeLog | 6 ++++++ harbour/src/rtl/net.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index e53d869caf..2681f38d3f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,12 @@ The license applies to all entries newer than 2009-04-28. */ +2011-05-09 15:54 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/net.c + ! NETNAME(): fixed potential GPF on linux/watcom builds + ! HB_USERNAME(): fixed potential GPF on *nix and os2 builds + ; Pls chk me + 2011-05-09 15:25 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/wapi_misc.c ! trying to make hbwapi_LoadLibrarySystem() really safe diff --git a/harbour/src/rtl/net.c b/harbour/src/rtl/net.c index af9c5dda07..6d987c44c3 100644 --- a/harbour/src/rtl/net.c +++ b/harbour/src/rtl/net.c @@ -224,10 +224,20 @@ char * hb_username( void ) HB_FUNC( NETNAME ) { - hb_retc_buffer( ( char * ) hb_osDecodeCP( hb_netname(), NULL, NULL ) ); + char * buffer = hb_netname(); + + if( buffer ) + hb_retc_buffer( ( char * ) hb_osDecodeCP( buffer, NULL, NULL ) ); + else + hb_retc_null(); } HB_FUNC( HB_USERNAME ) { - hb_retc_buffer( ( char * ) hb_osDecodeCP( hb_username(), NULL, NULL ) ); + char * buffer = hb_username(); + + if( buffer ) + hb_retc_buffer( ( char * ) hb_osDecodeCP( buffer, NULL, NULL ) ); + else + hb_retc_null(); }