From d7ccd6202e63b6d3466f8daebba371d0d0808de0 Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Tue, 30 Jun 2009 11:32:16 +0000 Subject: [PATCH] 2009-06-30 13:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/datec.c * added workaround for CodeGuard false bug report covered by __CODEGUARD__ macro. Chen, if possible please test. --- harbour/ChangeLog | 5 +++++ harbour/source/rtl/datec.c | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9bcdcb16c8..4a1404151d 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,11 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-30 13:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/datec.c + * added workaround for CodeGuard false bug report covered by + __CODEGUARD__ macro. Chen, if possible please test. + 2009-06-30 12:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/include/hbrdddbf.h ! fixed declaration diff --git a/harbour/source/rtl/datec.c b/harbour/source/rtl/datec.c index e0aa8aa3fb..dcec6cf5ee 100644 --- a/harbour/source/rtl/datec.c +++ b/harbour/source/rtl/datec.c @@ -56,18 +56,24 @@ #include "hbapilng.h" #include "hbdate.h" +#if defined(__CODEGUARD__) + static const char s_nullStr[ 4 ] = { 0 }; +#else +# define s_nullStr "" +#endif + const char * hb_dateCMonth( int iMonth ) { HB_TRACE(HB_TR_DEBUG, ("hb_dateCMonth(%d)", iMonth)); - return ( iMonth >= 1 && iMonth <= 12 ) ? hb_langDGetItem( HB_LANG_ITEM_BASE_MONTH + iMonth - 1 ) : ""; + return ( iMonth >= 1 && iMonth <= 12 ) ? hb_langDGetItem( HB_LANG_ITEM_BASE_MONTH + iMonth - 1 ) : s_nullStr; } const char * hb_dateCDOW( int iDay ) { HB_TRACE(HB_TR_DEBUG, ("hb_dateCDOW(%d)", iDay)); - return ( iDay >= 1 && iDay <= 7 ) ? hb_langDGetItem( HB_LANG_ITEM_BASE_DAY + iDay - 1 ) : ""; + return ( iDay >= 1 && iDay <= 7 ) ? hb_langDGetItem( HB_LANG_ITEM_BASE_DAY + iDay - 1 ) : s_nullStr; } HB_FUNC( CMONTH )