# HG changeset patch # User Stu Tomlinson # Date 1177383113 0 # Node ID 2cf8383a806f7024e6fff4e440a3280460de716c # Parent d3d18abf5df50b2ce475d75193db03850f2e6176 nosnilmot: those magic numbers should probably have been fixed to not be so magic ;-) This should help us for the next time we need to rename. diff -r d3d18abf5df5 -r 2cf8383a806f libpurple/plugins/tcl/tcl_ref.c --- a/libpurple/plugins/tcl/tcl_ref.c Tue Apr 24 01:44:49 2007 +0000 +++ b/libpurple/plugins/tcl/tcl_ref.c Tue Apr 24 02:51:53 2007 +0000 @@ -114,16 +114,17 @@ char *ptr; PurpleStringref *type; void *value; + int magicnumber = strlen("purple-"); - if (strlen(bytes) < 7 - || strncmp(bytes, "purple-", 7) + if (strlen(bytes) < magicnumber + || strncmp(bytes, "purple-", magicnumber) || (ptr = strchr(bytes, ':')) == NULL - || (ptr - bytes) == 7) + || (ptr - bytes) == magicnumber) goto badobject; /* Bad Ethan */ *ptr = '\0'; - type = purple_stringref_new(bytes + 7); + type = purple_stringref_new(bytes + magicnumber); *ptr = ':'; ptr++;