src/protocols/yahoo/yahoo.c

changeset 8616
def20c824c3a
parent 8591
ae42ad1cd127
child 8617
ee1d90584422
equal deleted inserted replaced
8615:7db99c77c41e 8616:def20c824c3a
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

mercurial