diff --git a/include/info.h b/include/info.h index b396153..c65de7c 100644 --- a/include/info.h +++ b/include/info.h @@ -36,8 +36,8 @@ char *Info_ValueForKey (char *s, char *key); void Info_RemoveKey (char *s, char *key); void Info_RemovePrefixedKeys (char *start, char prefix); -void Info_SetValueForKey (char *s, char *key, char *value, int maxsize); -void Info_SetValueForStarKey (char *s, char *key, char *value, int maxsize); +void Info_SetValueForKey (char *s, char *key, char *value, size_t maxsize); +void Info_SetValueForStarKey (char *s, char *key, char *value, size_t maxsize); void Info_Print (char *s); #endif // _INFO_H diff --git a/source/checksum.c b/source/checksum.c index ea34012..ce7d6e1 100644 --- a/source/checksum.c +++ b/source/checksum.c @@ -152,5 +152,5 @@ byte COM_BlockSequenceCRCByte (byte *base, int length, int sequence) crc &= 0xff; - return crc; + return (byte) crc; } diff --git a/source/info.c b/source/info.c index e6e5349..dfdf87a 100644 --- a/source/info.c +++ b/source/info.c @@ -190,7 +190,7 @@ void Info_RemovePrefixedKeys (char *start, char prefix) } -void Info_SetValueForStarKey (char *s, char *key, char *value, int maxsize) +void Info_SetValueForStarKey (char *s, char *key, char *value, size_t maxsize) { char newstr[1024], *v; int c, is_name, is_team; @@ -257,7 +257,7 @@ void Info_SetValueForStarKey (char *s, char *key, char *value, int maxsize) *s = 0; } -void Info_SetValueForKey (char *s, char *key, char *value, int maxsize) +void Info_SetValueForKey (char *s, char *key, char *value, size_t maxsize) { if (key[0] == '*') { diff --git a/source/locs.c b/source/locs.c index 65f7fcf..273004e 100644 --- a/source/locs.c +++ b/source/locs.c @@ -135,9 +135,9 @@ void locs_reset() } free(locations); - locations=0; locations_alloced = 0; locations_count = 0; + locations = NULL; } void locs_more() diff --git a/source/teamplay.c b/source/teamplay.c index 29df22e..2b296fe 100644 --- a/source/teamplay.c +++ b/source/teamplay.c @@ -160,8 +160,7 @@ char *Team_ParseSay (char *s) location = locs_find(death_location); if (location) { recorded_location = true; - memcpy(last_recorded_location, death_location, - sizeof(last_recorded_location)); + VectorCopy(death_location, last_recorded_location); t1 = location->name; break; } @@ -180,11 +179,10 @@ char *Team_ParseSay (char *s) case 'l': location: bracket = 0; - location = locs_find(r_origin); + location = locs_find(cl.simorg); if (location) { recorded_location = true; - memcpy(last_recorded_location, r_origin, - sizeof(last_recorded_location)); + VectorCopy(cl.simorg, last_recorded_location); t1 = location->name; } else snprintf(t2, sizeof(t2), "Unknown!\n"); @@ -276,7 +274,7 @@ location: void Team_Dead () { died = true; - memcpy(death_location, r_origin, sizeof(death_location)); + VectorCopy(cl.simorg, death_location); } void Team_NewMap ()