From 5c830ca7104e45bf0134656a70704e919bad4af7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sun, 6 Dec 2009 03:11:48 +0000 Subject: [PATCH] 2009-12-06 04:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbide/ideparseexpr.c ! Fixed to use hb_strncpy() instead of strncpy(). * contrib/hbwin/win_os.prg + Added comment to indicate parameter accepted as reference. --- harbour/ChangeLog | 9 ++++++++- harbour/contrib/hbide/ideparseexpr.c | 4 +--- harbour/contrib/hbwin/win_os.prg | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c52de5d397..6f08da25e7 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,13 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-12-06 04:10 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbide/ideparseexpr.c + ! Fixed to use hb_strncpy() instead of strncpy(). + + * contrib/hbwin/win_os.prg + + Added comment to indicate parameter accepted as reference. + 2009-12-06 03:46 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbwin/Makefile * contrib/hbwin/win_reg.prg @@ -124,7 +131,7 @@ ! Fixed to use hb_strncat() instead of strcat(). ! Fixed unsafe '!' oparator usage. (MSVC C++ warning) ; TOFIX: There is still one unsafe strncpy() usage, but I can't fix it. - Anyone? + Anyone? [DID IT] 2009-12-05 15:14 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbide/ideparseexpr.c diff --git a/harbour/contrib/hbide/ideparseexpr.c b/harbour/contrib/hbide/ideparseexpr.c index 73e1f672ba..7a83aacdc4 100644 --- a/harbour/contrib/hbide/ideparseexpr.c +++ b/harbour/contrib/hbide/ideparseexpr.c @@ -289,9 +289,7 @@ HB_FUNC( PARSEXPR ) /* ( c, bHonorSpacing, bInRemark, bUpperKeyWord, bKeepCommen { if( bKeepComments ) { - /* TOFIX: To use hb_strncpy() */ - strncpy( szNextWord + wordlen, pszExpr, npos + 1 ); - szNextWord[ wordlen + npos + 1 ] = '\0'; + hb_strncpy( szNextWord + wordlen, pszExpr, sizeof( szNextWord ) - 1 - wordlen ); lenwords++; hb_arrayAdd( paExpr, hb_itemPutC( pTemp, szNextWord ) ); } diff --git a/harbour/contrib/hbwin/win_os.prg b/harbour/contrib/hbwin/win_os.prg index 23b95cbffa..829a4049c0 100644 --- a/harbour/contrib/hbwin/win_os.prg +++ b/harbour/contrib/hbwin/win_os.prg @@ -114,7 +114,7 @@ FUNCTION WIN_OSNETREGOK( lSetIt, lDoVista ) RETURN bRetVal -FUNCTION WIN_OSNETVREDIROK( nResult ) +FUNCTION WIN_OSNETVREDIROK( /* @ */ nResult ) LOCAL a nResult := 0