[winpr,wlog] fix integer narrow

This commit is contained in:
akallabeth 2024-09-25 03:48:55 +02:00
parent 8a042b33d6
commit 4783546582
No known key found for this signature in database
GPG Key ID: A49454A3FC909FD5

View File

@ -19,6 +19,7 @@
#include <winpr/config.h>
#include <assert.h>
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@ -755,7 +756,8 @@ LONG WLog_GetFilterLogLevel(wLog* log)
if (_stricmp(filter->Names[j], "*") == 0)
{
match = TRUE;
log->FilterLevel = filter->Level;
assert(filter->Level <= INT32_MAX);
log->FilterLevel = (LONG)filter->Level;
break;
}
@ -766,7 +768,10 @@ LONG WLog_GetFilterLogLevel(wLog* log)
{
match = log->NameCount == filter->NameCount;
if (match)
log->FilterLevel = filter->Level;
{
assert(filter->Level <= INT32_MAX);
log->FilterLevel = (LONG)filter->Level;
}
break;
}
}