Fix computation (#325)

- 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)

Co-authored-by: Tom Sheffler <tom.sheffler@gmail.com>
This commit is contained in:
McLaren Labs 2025-01-03 01:31:59 -08:00 committed by GitHub
parent 3a3a8c47c9
commit a8018d6c8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

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)
{