Moved assignment to within safe block

This commit is contained in:
Robert Osfield
2016-06-29 17:56:11 +01:00
parent d0bf7e8ce7
commit 274a197a82
2 changed files with 5 additions and 2 deletions

View File

@@ -1942,7 +1942,10 @@ YY_BUFFER_STATE yyFlexLexer::yy_create_buffer( std::istream* file, int size )
b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
if ( ! b )
{
YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
return 0;
}
b->yy_buf_size = size;

View File

@@ -607,10 +607,10 @@ bool ZipArchive::CheckZipErrorCode(ZRESULT result) const
{
unsigned buf_size = 1025;
char* buf = new (std::nothrow) char[buf_size];
buf[buf_size - 1] = 0;
if (buf)
{
buf[buf_size - 1] = 0;
FormatZipMessage(result, buf, buf_size - 1);
//print error message