Merge pull request #632 from alabuzhev/size_t_to_int_warning

Suppress MSVC warning C4267: conversion from 'size_t' to 'int', possible loss of data
This commit is contained in:
Lee Thomason 2017-11-28 15:40:48 -08:00 committed by GitHub
commit 2ab76dab6d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2418,7 +2418,7 @@ void XMLPrinter::Write( const char* data, size_t size )
fwrite ( data , sizeof(char), size, _fp); fwrite ( data , sizeof(char), size, _fp);
} }
else { else {
char* p = _buffer.PushArr( size ) - 1; // back up over the null terminator. char* p = _buffer.PushArr( static_cast<int>(size) ) - 1; // back up over the null terminator.
memcpy( p, data, size ); memcpy( p, data, size );
p[size] = 0; p[size] = 0;
} }