Differences From Artifact [6d4c66aa16]:
- File
src/OFObject+KeyValueCoding.m
— part of check-in
[49ed0fa5ec]
at
2016-06-05 16:04:11
on branch trunk
— Key Value Coding: Make sure free is always called
In theory, if -[UTF8String] would throw, this could leak. (user: js, size: 5664) [annotate] [blame] [check-ins using]
To Artifact [3eca7b4ec4]:
- File
src/OFObject+KeyValueCoding.m
— part of check-in
[09a0d12bae]
at
2016-06-05 21:17:57
on branch trunk
— Always cast to unsigned char for to{upper,lower}()
This is required as passing something signed to it is an error on
NetBSD, but passing anything else than a char is undefined on Linux. (user: js, size: 5694) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
60 61 62 63 64 65 66 | exceptionWithRequestedSize: keyLength + 3]; @try { memcpy(name, "is", 2); memcpy(name + 2, [key UTF8String], keyLength); name[keyLength + 2] = '\0'; | | | 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | exceptionWithRequestedSize: keyLength + 3]; @try { memcpy(name, "is", 2); memcpy(name + 2, [key UTF8String], keyLength); name[keyLength + 2] = '\0'; name[2] = toupper((unsigned char)name[2]); selector = sel_registerName(name); } @finally { free(name); } typeEncoding = [self typeEncodingForSelector: selector]; |
︙ | ︙ | |||
142 143 144 145 146 147 148 | exceptionWithRequestedSize: keyLength + 5]; @try { memcpy(name, "set", 3); memcpy(name + 3, [key UTF8String], keyLength); memcpy(name + keyLength + 3, ":", 2); | | | 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 | exceptionWithRequestedSize: keyLength + 5]; @try { memcpy(name, "set", 3); memcpy(name + 3, [key UTF8String], keyLength); memcpy(name + keyLength + 3, ":", 2); name[3] = toupper((unsigned char)name[3]); selector = sel_registerName(name); } @finally { free(name); } typeEncoding = [self typeEncodingForSelector: selector]; |
︙ | ︙ |