openbsd-ports/devel/cmake/patches/patch-Source_cmListFileLexer_c
espie 8063f8ee22 find qmake4, not qmake...
regen other patches with new diff.
2007-03-20 11:23:10 +00:00

36 lines
1.3 KiB
Plaintext

$OpenBSD: patch-Source_cmListFileLexer_c,v 1.3 2007/03/20 11:23:10 espie Exp $
--- Source/cmListFileLexer.c.orig Wed Jan 10 18:59:13 2007
+++ Source/cmListFileLexer.c Sun Mar 18 13:52:03 2007
@@ -2088,7 +2088,7 @@ static void cmListFileLexerSetToken(cmListFileLexer* l
{
if(text && length < lexer->size)
{
- strcpy(lexer->token.text, text);
+ strlcpy(lexer->token.text, text, lexer->size);
lexer->token.length = length;
return;
}
@@ -2121,7 +2121,7 @@ static void cmListFileLexerAppend(cmListFileLexer* lex
newSize = lexer->token.length + length + 1;
if(lexer->token.text && newSize <= lexer->size)
{
- strcpy(lexer->token.text+lexer->token.length, text);
+ strlcpy(lexer->token.text+lexer->token.length, text, lexer->size - lexer->token.length);
lexer->token.length += length;
return;
}
@@ -2239,11 +2239,11 @@ int cmListFileLexer_SetString(cmListFileLexer* lexer,
cmListFileLexerDestroy(lexer);
if(text)
{
- int length = (int)strlen(text);
+ size_t length = strlen(text);
lexer->string_buffer = (char*)malloc(length+1);
if(lexer->string_buffer)
{
- strcpy(lexer->string_buffer, text);
+ strlcpy(lexer->string_buffer, text, length+1);
lexer->string_position = lexer->string_buffer;
lexer->string_left = length;
}