From f4897860b50e2d1cc3b97a00d1f5a2e9e9c04faa Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sun, 27 Jan 2002 20:45:59 +0000 Subject: toupper(), tolower(), isspace(), is..etc..() aren't safe with chars in some systems, use our own is_...() functions now instead. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2348 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/special-vars.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/core/special-vars.c') diff --git a/src/core/special-vars.c b/src/core/special-vars.c index d961bd58..36d0743c 100644 --- a/src/core/special-vars.c +++ b/src/core/special-vars.c @@ -30,10 +30,10 @@ #define ALIGN_PAD 0x04 #define isvarchar(c) \ - (isalnum(c) || (c) == '_') + (i_isalnum(c) || (c) == '_') #define isarg(c) \ - (isdigit(c) || (c) == '*' || (c) == '~' || (c) == '-') + (i_isdigit(c) || (c) == '*' || (c) == '~' || (c) == '-') static SPECIAL_HISTORY_FUNC history_func = NULL; @@ -54,7 +54,7 @@ static char *get_argument(char **cmd, char **arglist) /* get last argument */ arg = max = argcount-1; } else { - if (isdigit(**cmd)) { + if (i_isdigit(**cmd)) { /* first argument */ arg = max = (**cmd)-'0'; (*cmd)++; @@ -63,7 +63,7 @@ static char *get_argument(char **cmd, char **arglist) if (**cmd == '-') { /* get more than one argument */ (*cmd)++; - if (!isdigit(**cmd)) + if (!i_isdigit(**cmd)) max = -1; /* get all the rest */ else { max = (**cmd)-'0'; @@ -163,7 +163,7 @@ static char *get_variable(char **cmd, SERVER_REC *server, void *item, get_argument(cmd, arglist); } - if (isalpha(**cmd) && isvarchar((*cmd)[1])) { + if (i_isalpha(**cmd) && isvarchar((*cmd)[1])) { /* long variable name.. */ return get_long_variable(cmd, server, item, free_ret, getname); } @@ -287,7 +287,7 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad) /* '!' = don't cut, '-' = right padding */ str = *data; - while (*str != '\0' && *str != ']' && !isdigit(*str)) { + while (*str != '\0' && *str != ']' && !i_isdigit(*str)) { if (*str == '!') *flags &= ~ALIGN_CUT; else if (*str == '-') @@ -296,11 +296,11 @@ static int get_alignment_args(char **data, int *align, int *flags, char *pad) *flags &= ~ALIGN_PAD; str++; } - if (!isdigit(*str)) + if (!i_isdigit(*str)) return FALSE; /* expecting number */ /* get the alignment size */ - while (isdigit(*str)) { + while (i_isdigit(*str)) { *align = (*align) * 10 + (*str-'0'); str++; } -- cgit v1.2.3