libpurple/plugins/tcl/tcl_ref.c

changeset 34304
faf0414a8b51
parent 31956
f2b6b7f5631b
child 38259
c593fc9f5438
equal deleted inserted replaced
34302:3949b825f4bf 34304:faf0414a8b51
115 char *bytes = Tcl_GetStringFromObj(obj, NULL); 115 char *bytes = Tcl_GetStringFromObj(obj, NULL);
116 char *ptr; 116 char *ptr;
117 PurpleStringref *type; 117 PurpleStringref *type;
118 void *value; 118 void *value;
119 static const char prefix[] = "purple-"; 119 static const char prefix[] = "purple-";
120 static const int prefixlen = sizeof(prefix) - 1; 120 static const gsize prefixlen = sizeof(prefix) - 1;
121 121
122 if (strlen(bytes) < prefixlen 122 if (strlen(bytes) < prefixlen
123 || strncmp(bytes, prefix, prefixlen) 123 || strncmp(bytes, prefix, prefixlen)
124 || (ptr = strchr(bytes, ':')) == NULL 124 || (ptr = strchr(bytes, ':')) == NULL
125 || (ptr - bytes) == prefixlen) 125 || (gsize)(ptr - bytes) == prefixlen)
126 goto badobject; 126 goto badobject;
127 127
128 /* Bad Ethan */ 128 /* Bad Ethan */
129 *ptr = '\0'; 129 *ptr = '\0';
130 type = purple_stringref_new(bytes + prefixlen); 130 type = purple_stringref_new(bytes + prefixlen);

mercurial