src/protocols/msn/msn.c

changeset 2093
428ab5f88e15
parent 2090
bab8b7e309db
child 2123
4cfdde0aa3f1
--- 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;
 

mercurial