changeset 2093:83d8a9b7e89b

[gaim-migrate @ 2103] ben winslow's url_decode fix committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 01 Aug 2001 00:20:44 +0000
parents 59b0377d18aa
children be10a1243ed7
files src/protocols/msn/msn.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/msn/msn.c	Wed Aug 01 00:10:16 2001 +0000
+++ b/src/protocols/msn/msn.c	Wed Aug 01 00:20:44 2001 +0000
@@ -101,9 +101,11 @@
 			buf[j++] = msg[i];
 			continue;
 		}
-		g_snprintf(hex, sizeof(hex), "%s", msg + ++i);
-		i++;
-		sscanf(hex, "%%x", (unsigned int *)&buf[j++]);
+		strncpy(hex, msg + ++i, 2); hex[2] = 0;
+		/* i is pointing to the start of the number */
+		i++; /* now it's at the end and at the start of the for loop
+			will be at the next character */
+		buf[j++] = strtol(hex, NULL, 16);
 	}
 	buf[j] = 0;