File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -306,7 +306,7 @@ bool Debugger::SetBaseline()
306
306
#ifdef _WIN32
307
307
LPSTR script = nullptr ;
308
308
FILE *file = nullptr ;
309
- int numChars = 0 ;
309
+ size_t numChars = 0 ;
310
310
HRESULT hr = S_OK;
311
311
312
312
if (_wfopen_s (&file, HostConfigFlags::flags.dbgbaseline , _u (" rb" )) != 0 )
@@ -316,13 +316,13 @@ bool Debugger::SetBaseline()
316
316
317
317
if (file != nullptr )
318
318
{
319
- int fileSize = _filelength (_fileno (file));
320
- if (fileSize <= MAX_BASELINE_SIZE)
319
+ long fileSize = _filelength (_fileno (file));
320
+ if (0 <= fileSize && fileSize <= MAX_BASELINE_SIZE)
321
321
{
322
- script = new char [fileSize + 1 ];
322
+ script = new char [( size_t ) fileSize + 1 ];
323
323
324
- numChars = static_cast < int >( fread (script, sizeof (script[0 ]), fileSize, file) );
325
- if (numChars == fileSize)
324
+ numChars = fread (script, sizeof (script[0 ]), fileSize, file);
325
+ if (numChars == ( size_t ) fileSize)
326
326
{
327
327
script[numChars] = ' \0 ' ;
328
328
You can’t perform that action at this time.
0 commit comments