openbsd-ports/textproc/xxdiff/patches/patch-src_buffer_cpp

21 lines
801 B
Plaintext

--- src/buffer.cpp.orig Wed Jun 20 14:41:45 2001
+++ src/buffer.cpp Wed Jun 20 14:51:13 2001
@@ -248,7 +248,7 @@ void XxBuffer::loadDirectory( struct sta
}
char* newString = new char[ d_size + 1 ];
- ::strncpy( newString, d_name, d_size );
+ ::strlcpy( newString, d_name, d_size );
newString[ d_size ] = 0;
XX_CHECK( newString != 0 && d_name != 0 && d_size > 0 );
@@ -297,7 +297,7 @@ void XxBuffer::setDirectoryEntries(
char* bufferPtr = _buffer;
for ( uint ii = 0; ii < _directoryEntries.size(); ++ii ) {
int len = ::strlen( _directoryEntries[ii] );
- ::strncpy( bufferPtr, _directoryEntries[ii], len );
+ ::strlcpy( bufferPtr, _directoryEntries[ii], len );
bufferPtr[len] = '\n';
bufferPtr += len + 1;
}