Yet more char index issues.

Should be getting near the end of these as qfcc tries to link in my hacked
up tree :)
This commit is contained in:
Bill Currie 2012-08-18 21:42:49 +09:00
parent 7f805c2527
commit 9250eb83bf
5 changed files with 10 additions and 7 deletions

View file

@ -49,6 +49,7 @@
#include <stdlib.h>
#include "QF/hash.h"
#include "QF/qtypes.h"
#include "QF/sys.h"
#include "old_keys.h"
@ -246,7 +247,7 @@ OK_TranslateKeyName (const char *name)
const char *s = name;
char *d = uname;
while ((*d++ = toupper (*s)))
while ((*d++ = toupper ((byte) *s)))
s++;
ok = Hash_Find (old_key_table, uname);
if (!ok) {

View file

@ -384,9 +384,11 @@ SL_SortEntry (server_entry_t *start)
i = 0;
while ((start->desc[i] != '\0') && (q->desc[i] != '\0') &&
(toupper (start->desc[i]) == toupper (q->desc[i])))
(toupper ((byte) start->desc[i])
== toupper ((byte) q->desc[i])))
i++;
if (toupper (start->desc[i]) > toupper (q->desc[i])) {
if (toupper ((byte) start->desc[i])
> toupper ((byte) q->desc[i])) {
SL_Swap (start, q);
q = start;
}

View file

@ -227,7 +227,7 @@ CF_Open (const char *path, const char *mode)
j = fullpath->str + strlen (fullpath->str) - strlen (path);
for (i = 0; path[i]; i++, j++) // strcpy, but force lowercase
*j = tolower (path[i]);
*j = tolower ((byte) path[i]);
*j = '\0';
if (CF_AlreadyOpen (fullpath->str, mode[0])) {

View file

@ -66,8 +66,8 @@ cvar_t *sv_leetnickmatch;
static qboolean
match_char (char a, char b)
{
a = tolower (sys_char_map[(byte)a]);
b = tolower (sys_char_map[(byte)b]);
a = tolower ((byte) sys_char_map[(byte) a]);
b = tolower ((byte) sys_char_map[(byte) b]);
if (a == b || (sv_leetnickmatch->int_val
&& ( (a == '1' && b == 'i') || (a == 'i' && b == '1')

View file

@ -256,7 +256,7 @@ KK_qwchar (char c)
{
c &= 0x7f;
if (c >= ' ')
return tolower (c);
return tolower ((byte) c);
if (c >= 0x12 && c <= 0x1b)
return c - 0x12 + '0';
switch (c) {