Mercurial > pidgin
comparison src/protocols/yahoo/yahoo.c @ 8616:aa815d1a996d
[gaim-migrate @ 9367]
yahoo_decode bugfix
committer: Tailor Script <tailor@pidgin.im>
author | Ethan Blanton <elb@pidgin.im> |
---|---|
date | Thu, 08 Apr 2004 04:22:28 +0000 |
parents | f96795b786d2 |
children | 9bd849b376b4 |
comparison
equal
deleted
inserted
replaced
8615:f26e7dc1805e | 8616:aa815d1a996d |
---|---|
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 |