diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-26 13:28:44 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-03-26 13:28:44 +0000 |
commit | 1fba74f4c5b460718e8307bf41ee6c7fbb0dac5d (patch) | |
tree | 7552f86da0f74c0b0b7a6d5e4ab2af7c8c11b70f | |
parent | b6504a6c67b2ef6aef22ee6da66d11376102d294 (diff) |
MWS_SRX644: migrate branch mws_srx644 -> HEAD
-rw-r--r-- | rdbmaker/source/codemaker/dependency.cxx | 25 | ||||
-rw-r--r-- | rdbmaker/source/codemaker/global.cxx | 39 | ||||
-rw-r--r-- | rdbmaker/source/rdbmaker/makefile.mk | 6 | ||||
-rw-r--r-- | rdbmaker/source/rdbmaker/rdboptions.cxx | 5 |
4 files changed, 44 insertions, 31 deletions
diff --git a/rdbmaker/source/codemaker/dependency.cxx b/rdbmaker/source/codemaker/dependency.cxx index f74aeca95276..76d723d683c8 100644 --- a/rdbmaker/source/codemaker/dependency.cxx +++ b/rdbmaker/source/codemaker/dependency.cxx @@ -2,9 +2,9 @@ * * $RCSfile: dependency.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: jsc $ $Date: 2001-11-26 12:19:10 $ + * last change: $Author: hr $ $Date: 2003-03-26 14:28:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -351,16 +351,19 @@ sal_Bool checkTypeDependencies(TypeManager& typeMgr, TypeDependency& dependencie // make the scope modules as dependencies sal_Int32 nPos = type.lastIndexOf( '/' ); - OString aScope( type.copy( 0, nPos ) ); - OStringBuffer tmpBuf(aScope.getLength()); - - nPos = 0; - do + if ( nPos >= 0 ) { - tmpBuf.append(aScope.getToken(0, '/', nPos)); - dependencies.insert(type, tmpBuf.getStr(), TYPEUSE_SCOPE); - tmpBuf.append('/'); - } while( nPos != -1 ); + OString aScope( type.copy( 0, nPos ) ); + OStringBuffer tmpBuf(aScope.getLength()); + + nPos = 0; + do + { + tmpBuf.append(aScope.getToken(0, '/', nPos)); + dependencies.insert(type, tmpBuf.getStr(), TYPEUSE_SCOPE); + tmpBuf.append('/'); + } while( nPos != -1 ); + } return sal_True; } diff --git a/rdbmaker/source/codemaker/global.cxx b/rdbmaker/source/codemaker/global.cxx index bf3fc7a534eb..530f5c1b3571 100644 --- a/rdbmaker/source/codemaker/global.cxx +++ b/rdbmaker/source/codemaker/global.cxx @@ -2,9 +2,9 @@ * * $RCSfile: global.cxx,v $ * - * $Revision: 1.8 $ + * $Revision: 1.9 $ * - * last change: $Author: hr $ $Date: 2002-02-21 12:13:13 $ + * last change: $Author: hr $ $Date: 2003-03-26 14:28:43 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,7 +77,6 @@ #include <stdlib.h> #include <stdio.h> -#include <string.h> #if defined(SAL_W32) || defined(SAL_OS2) #include <io.h> #include <direct.h> @@ -122,34 +121,48 @@ OString makeTempName(sal_Char* prefix) if ( osl_getEnvironment(uTEMP.pData, &uPattern.pData) != osl_Process_E_None ) { #if defined(SAL_W32) || defined(SAL_OS2) - strcpy(tmpPattern, "."); + OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "." ) ); + strncpy(tmpPattern, ".", sizeof(tmpPattern)-1); #else - strcpy(tmpPattern, "/tmp"); + OSL_ASSERT( sizeof(tmpPattern) > RTL_CONSTASCII_LENGTH( "/tmp" ) ); + strncpy(tmpPattern, "/tmp", sizeof(tmpPattern)-1); #endif } } if (uPattern.getLength()) { - strcpy(tmpPattern, OUStringToOString(uPattern, RTL_TEXTENCODING_UTF8).getStr()); + OString aOStr( OUStringToOString(uPattern, RTL_TEXTENCODING_UTF8) ); + OSL_ASSERT( sizeof(tmpPattern) > aOStr.getLength() ); + strncpy(tmpPattern, aOStr.getStr(), sizeof(tmpPattern)-1); } #ifdef SAL_W32 - strcat(tmpPattern, "\\"); - strcat(tmpPattern, pPrefix); - strcat(tmpPattern, "XXXXXX"); + OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern) + + RTL_CONSTASCII_LENGTH("\\") + + strlen(pPrefix) + + RTL_CONSTASCII_LENGTH("XXXXXX") ) ); + strncat(tmpPattern, "\\", sizeof(tmpPattern)-1-strlen(tmpPattern)); + strncat(tmpPattern, pPrefix, sizeof(tmpPattern)-1-strlen(tmpPattern)); + strncat(tmpPattern, "XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern)); pTmpName = mktemp(tmpPattern); #endif #ifdef SAL_OS2 - strcpy(tmpPattern, tempnam(NULL, prefix); + char* tmpname = tempnam(NULL, prefix); + OSL_ASSERT( sizeof(tmpPattern) > strlen(tmpname) ); + strncpy(tmpPattern, tmpname, sizeof(tmpPattern)-1); pTmpName = tmpPattern; #endif #ifdef SAL_UNX - strcat(tmpPattern, "\\"); - strcat(tmpPattern, pPrefix); - strcat(tmpPattern, "XXXXXX"); + OSL_ASSERT( sizeof(tmpPattern) > ( strlen(tmpPattern) + + RTL_CONSTASCII_LENGTH("/") + + strlen(pPrefix) + + RTL_CONSTASCII_LENGTH("XXXXXX") ) ); + strncat(tmpPattern, "/", sizeof(tmpPattern)-1-strlen(tmpPattern)); + strncat(tmpPattern, pPrefix, sizeof(tmpPattern)-1-strlen(tmpPattern)); + strncat(tmpPattern, "XXXXXX", sizeof(tmpPattern)-1-strlen(tmpPattern)); pTmpName = mktemp(tmpPattern); #endif diff --git a/rdbmaker/source/rdbmaker/makefile.mk b/rdbmaker/source/rdbmaker/makefile.mk index 1ac052e774e9..d8c598f8117f 100644 --- a/rdbmaker/source/rdbmaker/makefile.mk +++ b/rdbmaker/source/rdbmaker/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.13 $ +# $Revision: 1.14 $ # -# last change: $Author: hjs $ $Date: 2002-03-27 16:12:33 $ +# last change: $Author: hr $ $Date: 2003-03-26 14:28:44 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -110,8 +110,6 @@ APP1OBJS= $(OBJ)$/rdbmaker.obj \ $(OBJ)$/specialtypemanager.obj \ $(OBJ)$/rdbtype.obj -DEPOBJFILES= $(APP1OBJS) - APP1STDLIBS=\ $(SALLIB) \ $(SALHELPERLIB) \ diff --git a/rdbmaker/source/rdbmaker/rdboptions.cxx b/rdbmaker/source/rdbmaker/rdboptions.cxx index ea9ab867c8f2..ebe054fb985d 100644 --- a/rdbmaker/source/rdbmaker/rdboptions.cxx +++ b/rdbmaker/source/rdbmaker/rdboptions.cxx @@ -2,9 +2,9 @@ * * $RCSfile: rdboptions.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: hr $ $Date: 2002-02-21 12:15:47 $ + * last change: $Author: hr $ $Date: 2003-03-26 14:28:44 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -59,7 +59,6 @@ * ************************************************************************/ #include <stdio.h> -#include <string.h> #include "rdboptions.hxx" |