Differences From Artifact [b556a211fc]:
- File
src/OFStream.m
— part of check-in
[b464ddcda5]
at
2009-06-09 13:21:12
on branch trunk
— Handle reads with a returned size of 0 safely in -[readLine].
Before, it could call memcpy with size of 0 on a pointer that might be
NULL and thus might be undefined behaviour. This way, it's compatible to
the OFSocket change in the commit before. (user: js, size: 4592) [annotate] [blame] [check-ins using]
To Artifact [fc7e1fba0a]:
- File src/OFStream.m — part of check-in [328decd247] at 2009-07-17 11:25:49 on branch trunk — Use +[stringWithCString:andLength:] in -[readLine]. (user: js, size: 4170) [annotate] [blame] [check-ins using]
︙ | |||
66 67 68 69 70 71 72 | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | - - - + + - - - + - - - - - + - - - - - - - - - - - - + - - - + | OFString *ret; /* Look if there's a line or \0 in our cache */ if (cache != NULL) { for (i = 0; i < cache_len; i++) { if (OF_UNLIKELY(cache[i] == '\n' || cache[i] == '\0')) { |
︙ |