Changeset 6b13103 for otr.c


Ignore:
Timestamp:
2015-01-16T19:50:23Z (5 years ago)
Author:
dequis <dx@…>
Branches:
master
Children:
1065dd4, eabe6d4
Parents:
6f10697
Message:

Replace isdigit/isalpha/.../tolower/toupper with glib variants

This fixes warnings about passing signed chars to them (apparently they
are implemented as macros that do array lookups without checks in some
platforms, yay)

Specifically:

functions=isalnum|isalpha|isdigit|isspace|isxdigit|tolower|toupper
sed -ir "s/$functions/g_ascii_&/g" /*.c

File:
1 edited

Legend:

Unmodified
Added
Removed
  • otr.c

    r6f10697 r6b13103  
    14701470int hexval(char a)
    14711471{
    1472         int x=tolower(a);
     1472        int x=g_ascii_tolower(a);
    14731473       
    14741474        if(x>='a' && x<='f')
     
    15571557        for(i=0; args[i]; i++) {
    15581558                for(j=0; args[i][j]; j++) {
    1559                         char c = toupper(args[i][j]);
     1559                        char c = g_ascii_toupper(args[i][j]);
    15601560                       
    15611561                        if(n>=40) {
     
    16211621        for(i=0; args[i]; i++) {
    16221622                for(j=0; args[i][j]; j++) {
    1623                         char c = toupper(args[i][j]);
     1623                        char c = g_ascii_toupper(args[i][j]);
    16241624                       
    16251625                        if(n>=40) {
Note: See TracChangeset for help on using the changeset viewer.