Mercurial > hg > nnchat
comparison libnnchat.c @ 285:b765f15f9895
Move nn_username_{de,en}code() to libnnchat.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 10 Jun 2011 23:43:36 +0300 |
parents | 2cff949abbc5 |
children | 61884ce9db41 |
comparison
equal
deleted
inserted
replaced
284:dbf07a4eadd7 | 285:b765f15f9895 |
---|---|
897 hash->buckets[i] = NULL; | 897 hash->buckets[i] = NULL; |
898 } | 898 } |
899 | 899 |
900 th_free(hash); | 900 th_free(hash); |
901 } | 901 } |
902 | |
903 | |
904 char *nn_username_encode(char *str) | |
905 { | |
906 unsigned char *c = (unsigned char *) str; | |
907 if (str == NULL) return NULL; | |
908 for (; *c ; c++) | |
909 if (*c == ' ') *c = 255; | |
910 return str; | |
911 } | |
912 | |
913 | |
914 char *nn_username_decode(char *str) | |
915 { | |
916 unsigned char *c = (unsigned char *) str; | |
917 if (str == NULL) return NULL; | |
918 for (; *c ; c++) | |
919 if (*c == 255) *c = ' '; | |
920 return str; | |
921 } | |
922 | |
923 |