summaryrefslogtreecommitdiff
path: root/xml2cmp
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2003-04-15 17:43:40 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2003-04-15 17:43:40 +0000
commitb1b49a56027a0a5c6c5e937428d9d7bf711b561b (patch)
treea3ed43f800fbb9be44a555b47048b99bca6a9610 /xml2cmp
parentb3f6e480ce53ad8955339253cbfa66315ce89249 (diff)
INTEGRATION: CWS adc5 (1.6.18); FILE MERGED
2003/04/14 14:49:07 np 1.6.18.1: 107553
Diffstat (limited to 'xml2cmp')
-rw-r--r--xml2cmp/source/xcd/parse.cxx38
1 files changed, 21 insertions, 17 deletions
diff --git a/xml2cmp/source/xcd/parse.cxx b/xml2cmp/source/xcd/parse.cxx
index a79cd91688d8..e95b880cefd2 100644
--- a/xml2cmp/source/xcd/parse.cxx
+++ b/xml2cmp/source/xcd/parse.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: parse.cxx,v $
*
- * $Revision: 1.6 $
+ * $Revision: 1.7 $
*
- * last change: $Author: np $Date: 2002/08/08 16:08:20 $
+ * last change: $Author: hr $Date$
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -383,23 +383,27 @@ X2CParser::GetTextTill( Simstr & o_rText,
if (i_bReverseName)
{
- char * sBreak = strrchr(pResult,'.');
- if (sBreak != 0)
+ const nMaxLen = 1000;
+ if (strlen(pResult) < nMaxLen)
{
- static char sScope[1000];
- static char sName[1000];
-
- unsigned nScopeLen = sBreak - pResult;
- strncpy ( sScope, pResult, nScopeLen );
- sScope[nScopeLen] = '\0';
- strcpy( sName, sBreak + 1 );
- strcat( sName, " in " );
- strcat( sName, sScope );
-
- o_rText = sName;
- return;
+ char * sBreak = strrchr(pResult,'.');
+ if (sBreak != 0)
+ {
+ static char sScope[nMaxLen+10];
+ static char sName[nMaxLen+10];
+
+ unsigned nScopeLen = sBreak - pResult;
+ strncpy ( sScope, pResult, nScopeLen ); // STRNCPY SAFE HERE
+ sScope[nScopeLen] = '\0';
+ strcpy( sName, sBreak + 1 ); // STRCPY SAFE HERE
+ strcat( sName, " in " ); // STRCAT SAFE HERE
+ strcat( sName, sScope ); // STRCAT SAFE HERE
+
+ o_rText = sName;
+ return;
+ }
}
- }
+ } // endif (i_bReverseName)
o_rText = &sWord[0];
}