740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
|
stringWithCString: rcs
encoding: encoding
length: rl];
} @catch (id e) {
if (bufferLength > 0) {
/*
* Append data to _readBuffer
* to prevent loss of data due
* to wrong encoding.
*/
readBuffer = [self
allocMemoryWithSize:
_readBufferLength +
bufferLength];
memcpy(readBuffer, _readBuffer,
|
|
<
|
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
|
stringWithCString: rcs
encoding: encoding
length: rl];
} @catch (id e) {
if (bufferLength > 0) {
/*
* Append data to _readBuffer
* to prevent loss of data.
*/
readBuffer = [self
allocMemoryWithSize:
_readBufferLength +
bufferLength];
memcpy(readBuffer, _readBuffer,
|
968
969
970
971
972
973
974
975
976
977
978
979
980
981
|
char *rcs = retCString;
size_t rl = retLength;
ret = [OFString
stringWithCString: rcs
encoding: encoding
length: rl];
} @finally {
[self freeMemory: retCString];
}
readBuffer = [self allocMemoryWithSize:
bufferLength - i - 1];
if (readBuffer != NULL)
|
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
|
char *rcs = retCString;
size_t rl = retLength;
ret = [OFString
stringWithCString: rcs
encoding: encoding
length: rl];
} @catch (id e) {
if (bufferLength > 0) {
/*
* Append data to _readBuffer
* to prevent loss of data.
*/
readBuffer = [self
allocMemoryWithSize:
_readBufferLength +
bufferLength];
memcpy(readBuffer, _readBuffer,
_readBufferLength);
memcpy(readBuffer +
_readBufferLength,
buffer, bufferLength);
[self freeMemory:
_readBufferMemory];
_readBuffer = readBuffer;
_readBufferMemory = readBuffer;
_readBufferLength +=
bufferLength;
}
@throw e;
} @finally {
[self freeMemory: retCString];
}
readBuffer = [self allocMemoryWithSize:
bufferLength - i - 1];
if (readBuffer != NULL)
|