ObjFW  Diff

Differences From Artifact [8a25c414b4]:

To Artifact [9c27c4838b]:


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

#import "config.h"

#import <stdio.h>
#import <stdlib.h>
#import <string.h>
#import <unistd.h>
#include <wchar.h>  /* include due to glibc brokenness */

#import "OFSocket.h"
#import "OFExceptions.h"

@implementation OFSocketAddress
+ newWithHost: (const char*)host
      andPort: (uint16_t)port







<







11
12
13
14
15
16
17

18
19
20
21
22
23
24

#import "config.h"

#import <stdio.h>
#import <stdlib.h>
#import <string.h>
#import <unistd.h>


#import "OFSocket.h"
#import "OFExceptions.h"

@implementation OFSocketAddress
+ newWithHost: (const char*)host
      andPort: (uint16_t)port
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
}

- (size_t)writeCString: (const char*)str
{
	return [self writeNBytes: strlen(str)
		      fromBuffer: (const uint8_t*)str];
}

- (size_t)writeWideCString: (const wchar_t*)str
{
	size_t len = wcslen(str);

	if (len > SIZE_MAX / sizeof(wchar_t))
		[[OFOutOfRangeException newWithObject: self] raise];

	return [self writeNBytes: len * sizeof(wchar_t)
		      fromBuffer: (const uint8_t*)str];
}
@end







<
<
<
<
<
<
<
<
<
<
<

166
167
168
169
170
171
172











173
}

- (size_t)writeCString: (const char*)str
{
	return [self writeNBytes: strlen(str)
		      fromBuffer: (const uint8_t*)str];
}











@end