Changeset 424e663 for lib/misc.c


Ignore:
Timestamp:
2008-06-22T09:32:46Z (16 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
fb4e9a3f
Parents:
98de2cc
Message:

Partial fix for #419: Moved normalize() and some other stuff to OSCAR
becuase it's the only place where it's used, and using this to strip
spaces from all screennames before sending them to BitlBee.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • lib/misc.c

    r98de2cc r424e663  
    6060        strcpy(text, text2);
    6161        g_free(text2);
    62 }
    63 
    64 char *normalize(const char *s)
    65 {
    66         static char buf[BUF_LEN];
    67         char *t, *u;
    68         int x = 0;
    69 
    70         g_return_val_if_fail((s != NULL), NULL);
    71 
    72         u = t = g_strdup(s);
    73 
    74         strcpy(t, s);
    75         g_strdown(t);
    76 
    77         while (*t && (x < BUF_LEN - 1)) {
    78                 if (*t != ' ') {
    79                         buf[x] = *t;
    80                         x++;
    81                 }
    82                 t++;
    83         }
    84         buf[x] = '\0';
    85         g_free(u);
    86         return buf;
    8762}
    8863
Note: See TracChangeset for help on using the changeset viewer.