Fix computation

- start of string is (name+9)
  - 'ptr' is the end of the desired substring, so the length
    should be (ptr - (name + 9))  which is (ptr - name) - 9)
This commit is contained in:
Tom Sheffler 2025-01-02 16:06:51 -08:00
parent 3a3a8c47c9
commit c3ed260bc4

View file

@ -942,8 +942,8 @@ typedef struct {
mth = [[GSThemeMethod new] autorelease];
types = method_getTypeEncoding(method);
mth->imp = method_getImplementation(method);
memcpy(buf, name + 9, (ptr - name) + 9);
buf[(ptr - name) + 9] = '\0';
memcpy(buf, name + 9, (ptr - name) - 9);
buf[(ptr - name) - 9] = '\0';
mth->cls = objc_lookUpClass(buf);
if (mth->cls == 0)
{