diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-12-25 15:18:13 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-12-25 15:18:13 +0200 |
commit | b12eef1d56575206538abed426a296fefe22e90e (patch) | |
tree | a029f5ec513ec487d477d791e21f90ae1287965a /src/peds | |
parent | 687ff4bdbb422bfb6364b25df91203b98481e6fa (diff) |
Fix use of strncmp
Diffstat (limited to 'src/peds')
-rw-r--r-- | src/peds/PedFight.cpp | 2 | ||||
-rw-r--r-- | src/peds/PedType.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/peds/PedFight.cpp b/src/peds/PedFight.cpp index b57364d8..6188f019 100644 --- a/src/peds/PedFight.cpp +++ b/src/peds/PedFight.cpp @@ -1778,7 +1778,7 @@ CPed::LoadFightData(void) break; } - if (strncmp(animName, "null", 4) != 0) { + if (strcmp(animName, "null") != 0) { animAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, animName); tFightMoves[moveId].animId = (AnimationId)animAssoc->animId; } else { diff --git a/src/peds/PedType.cpp b/src/peds/PedType.cpp index 6e745bd7..598c379d 100644 --- a/src/peds/PedType.cpp +++ b/src/peds/PedType.cpp @@ -79,7 +79,7 @@ CPedType::LoadPedData(void) // Game uses just "line" here since sscanf already trims whitespace, but this is safer sscanf(&line[lp], "%s", word); - if(strncmp(word, "Threat", 7) == 0){ + if(strcmp(word, "Threat") == 0){ flags = 0; lp += 7; while(sscanf(&line[lp], "%s", word) == 1 && lp <= linelen){ @@ -92,7 +92,7 @@ CPedType::LoadPedData(void) lp++; } ms_apPedType[type]->m_threats = flags; - }else if(strncmp(word, "Avoid", 6) == 0){ + }else if(strcmp(word, "Avoid") == 0){ flags = 0; lp += 6; while(sscanf(&line[lp], "%s", word) == 1 && lp <= linelen){ |