Mercurial > pidgin
comparison src/protocols/yahoo/yahoo.c @ 8125:abbfed0b0050
[gaim-migrate @ 8829]
there's a right way and a wrong way to kill off warnings
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Fri, 16 Jan 2004 17:13:20 +0000 |
parents | 52089b055c12 |
children | d5dbb02d2837 |
comparison
equal
deleted
inserted
replaced
8124:7ce787f82203 | 8125:abbfed0b0050 |
---|---|
878 #define OUT_CHARSET "utf-8" | 878 #define OUT_CHARSET "utf-8" |
879 | 879 |
880 static char *yahoo_decode(const char *text) | 880 static char *yahoo_decode(const char *text) |
881 { | 881 { |
882 char *converted; | 882 char *converted; |
883 char *p, *n, *new, *end; | 883 char *n, *new; |
884 const char *end, *p; | |
884 int i; | 885 int i; |
885 | 886 |
886 n = new = g_malloc(strlen (text) + 1); | 887 n = new = g_malloc(strlen (text) + 1); |
887 end = text + strlen(text); | 888 end = text + strlen(text); |
888 | 889 |
889 for (p = (char *)text; p < end; p++, n++) { | 890 for (p = text; p < end; p++, n++) { |
890 if (*p == '\\') { | 891 if (*p == '\\') { |
891 sscanf(p + 1, "%3o\n", &i); | 892 sscanf(p + 1, "%3o\n", &i); |
892 *n = (char)i; | 893 *n = i; |
893 p += 3; | 894 p += 3; |
894 } | 895 } |
895 else | 896 else |
896 *n = *p; | 897 *n = *p; |
897 } | 898 } |
898 | 899 |
899 *n = '\0'; | 900 *n = '\0'; |
900 | 901 |
901 converted = g_convert(new, n - new, OUT_CHARSET, "iso-8859-1", NULL, NULL, NULL); | 902 converted = g_convert(new, n - new, OUT_CHARSET, "iso-8859-1", NULL, NULL, NULL); |
902 g_free(new); | 903 g_free(new); |
903 | 904 |
904 return converted; | 905 return converted; |
905 } | 906 } |