mirror of
https://github.com/rehlds/rehlds.git
synced 2025-04-09 11:00:08 +03:00
Bugfix Info_ValueForKey: Fix wrong comparison
This commit is contained in:
parent
f324df867f
commit
2fa7655370
@ -73,6 +73,7 @@ const char* EXT_FUNC Info_ValueForKey(const char *s, const char *lookup)
|
|||||||
static char valueBuf[INFO_MAX_BUFFER_VALUES][MAX_KV_LEN];
|
static char valueBuf[INFO_MAX_BUFFER_VALUES][MAX_KV_LEN];
|
||||||
static int valueIndex;
|
static int valueIndex;
|
||||||
|
|
||||||
|
size_t lookupLen = Q_strlen(lookup);
|
||||||
while (*s == '\\')
|
while (*s == '\\')
|
||||||
{
|
{
|
||||||
// skip starting slash
|
// skip starting slash
|
||||||
@ -87,7 +88,6 @@ const char* EXT_FUNC Info_ValueForKey(const char *s, const char *lookup)
|
|||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t keyLen = s - key;
|
|
||||||
const char* value = ++s; // skip separating slash
|
const char* value = ++s; // skip separating slash
|
||||||
|
|
||||||
// skip value
|
// skip value
|
||||||
@ -96,7 +96,7 @@ const char* EXT_FUNC Info_ValueForKey(const char *s, const char *lookup)
|
|||||||
|
|
||||||
size_t valueLen = Q_min(s - value, MAX_KV_LEN - 1);
|
size_t valueLen = Q_min(s - value, MAX_KV_LEN - 1);
|
||||||
|
|
||||||
if (!Q_strncmp(key, lookup, keyLen))
|
if (!Q_strncmp(key, lookup, lookupLen))
|
||||||
{
|
{
|
||||||
char* dest = valueBuf[valueIndex];
|
char* dest = valueBuf[valueIndex];
|
||||||
Q_memcpy(dest, value, valueLen);
|
Q_memcpy(dest, value, valueLen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user