Overview
Comment: | Don't use alloca, as it could be unsafe. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
439216041bc60a569a00d3f4c96a1e57 |
User & Date: | js on 2012-02-28 14:29:32 |
Other Links: | manifest | tags |
Context
2012-02-28
| ||
16:20 | Update PLATFORMS. check-in: 3b618415fb user: js tags: trunk | |
14:29 | Don't use alloca, as it could be unsafe. check-in: 439216041b user: js tags: trunk | |
14:28 | Make it more clear that +[pluginFromFile:] does not return OFPlugin*. check-in: 0727c9266b user: js tags: trunk | |
Changes
Modified src/OFProcess.m from [be6e10ea82] to [39656659f7].
︙ | ︙ | |||
85 86 87 88 89 90 91 | @throw [OFInitializationFailedException exceptionWithClass: isa]; switch ((pid = fork())) { case 0:; OFString **cArray = [arguments cArray]; size_t i, count = [arguments count]; | | > > > | 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | @throw [OFInitializationFailedException exceptionWithClass: isa]; switch ((pid = fork())) { case 0:; OFString **cArray = [arguments cArray]; size_t i, count = [arguments count]; char **argv; argv = [self allocMemoryForNItems: count + 2 ofSize: sizeof(char*)]; argv[0] = (char*)[programName cStringWithEncoding: OF_STRING_ENCODING_NATIVE]; for (i = 0; i < count; i++) argv[i + 1] = (char*)[cArray[i] cStringWithEncoding: |
︙ | ︙ |
Modified src/OFString.m from [eb65ec8863] to [f2bf50723c].
︙ | ︙ | |||
18 19 20 21 22 23 24 | #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> | < < < < | 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #include <stdarg.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> #import "OFString.h" #import "OFString_UTF8.h" #import "OFArray.h" #import "OFDictionary.h" #import "OFFile.h" #import "OFURL.h" #import "OFHTTPRequest.h" |
︙ | ︙ | |||
1467 1468 1469 1470 1471 1472 1473 | [new makeImmutable]; return new; } - (BOOL)hasPrefix: (OFString*)prefix { | < > | > > > | | | | | | | > > > < > | > > > | | > | | | | | > > > | 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 | [new makeImmutable]; return new; } - (BOOL)hasPrefix: (OFString*)prefix { of_unichar_t *tmp; const of_unichar_t *prefixString; size_t prefixLength; int compare; if ((prefixLength = [prefix length]) > [self length]) return NO; tmp = [self allocMemoryForNItems: prefixLength ofSize: sizeof(of_unichar_t)]; @try { OFAutoreleasePool *pool; [self getCharacters: tmp inRange: of_range(0, prefixLength)]; pool = [[OFAutoreleasePool alloc] init]; prefixString = [prefix unicodeString]; compare = memcmp(tmp, prefixString, prefixLength * sizeof(of_unichar_t)); [pool release]; } @finally { [self freeMemory: tmp]; } return !compare; } - (BOOL)hasSuffix: (OFString*)suffix { of_unichar_t *tmp; const of_unichar_t *suffixString; size_t length, suffixLength; int compare; if ((suffixLength = [suffix length]) > [self length]) return NO; length = [self length]; tmp = [self allocMemoryForNItems: suffixLength ofSize: sizeof(of_unichar_t)]; @try { OFAutoreleasePool *pool; [self getCharacters: tmp inRange: of_range(length - suffixLength, suffixLength)]; pool = [[OFAutoreleasePool alloc] init]; suffixString = [suffix unicodeString]; compare = memcmp(tmp, suffixString, suffixLength * sizeof(of_unichar_t)); [pool release]; } @finally { [self freeMemory: tmp]; } return !compare; } - (OFArray*)componentsSeparatedByString: (OFString*)delimiter { return [self componentsSeparatedByString: delimiter |
︙ | ︙ |