mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
portbility fixes for mswindows
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@36829 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
9151fe541b
commit
f20a131f27
5 changed files with 23 additions and 10 deletions
|
@ -104,10 +104,16 @@
|
|||
{
|
||||
NSMutableData *result = [NSMutableData dataWithLength: 4];
|
||||
const char *cString = [address UTF8String];
|
||||
int elements[4];
|
||||
uint8_t *bytes = [result mutableBytes];
|
||||
|
||||
sscanf(cString, "%hhu.%hhu.%hhu.%hhu",
|
||||
&bytes[0], &bytes[1], &bytes[2], &bytes[3]);
|
||||
sscanf(cString, "%d.%d.%d.%d",
|
||||
&elements[0], &elements[1], &elements[2], &elements[3]);
|
||||
bytes[0] = (uint8_t)elements[0];
|
||||
bytes[1] = (uint8_t)elements[1];
|
||||
bytes[2] = (uint8_t)elements[2];
|
||||
bytes[3] = (uint8_t)elements[3];
|
||||
|
||||
return result;
|
||||
}
|
||||
case GSSocksAddressTypeIPv6:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue