| 900 static char *yahoo_decode(const char *text) |
900 static char *yahoo_decode(const char *text) |
| 901 { |
901 { |
| 902 char *converted; |
902 char *converted; |
| 903 char *n, *new; |
903 char *n, *new; |
| 904 const char *end, *p; |
904 const char *end, *p; |
| 905 int i; |
905 int i, k; |
| 906 |
906 |
| 907 n = new = g_malloc(strlen (text) + 1); |
907 n = new = g_malloc(strlen (text) + 1); |
| 908 end = text + strlen(text); |
908 end = text + strlen(text); |
| 909 |
909 |
| 910 for (p = text; p < end; p++, n++) { |
910 for (p = text; p < end; p++, n++) { |
| 911 if (*p == '\\') { |
911 if (*p == '\\') { |
| 912 sscanf(p + 1, "%3o\n", &i); |
912 sscanf(p + 1, "%3o%n\n", &i, &k); |
| 913 *n = i; |
913 *n = i; |
| 914 p += 3; |
914 p += k - 1; |
| 915 } |
915 } |
| 916 else |
916 else |
| 917 *n = *p; |
917 *n = *p; |
| 918 } |
918 } |
| 919 |
919 |