ObjFW  Check-in [1df0de873b]

Overview
Comment:Same again.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1df0de873b4fb80952944dd4b40e9daf67d455d891357e04361d0abadfea9d7a
User & Date: js on 2008-09-14 20:30:20
Other Links: manifest | tags
Context
2008-09-15
10:23
Add compare: for strings. check-in: 24ce530f56 user: js tags: trunk
2008-09-14
20:30
Same again. check-in: 1df0de873b user: js tags: trunk
20:19
Make more use of exceptions. check-in: de929f3cde user: js tags: trunk
Changes

Modified src/OFString.m from [bb64dfc30f] to [c2a52dd320].

61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
		length = 0;
		string = NULL;

		return self;
	}

	newlen = strlen(str);
	if ((newstr = [self getMem: newlen + 1]) == NULL)
		return nil;
	memcpy(newstr, str, newlen + 1);

	if (string != NULL)
		[self freeMem: string];

	length = newlen;
	string = newstr;







|
<







61
62
63
64
65
66
67
68

69
70
71
72
73
74
75
		length = 0;
		string = NULL;

		return self;
	}

	newlen = strlen(str);
	newstr = [self getMem: newlen + 1];

	memcpy(newstr, str, newlen + 1);

	if (string != NULL)
		[self freeMem: string];

	length = newlen;
	string = newstr;

Modified src/OFWideString.m from [5e1c99f438] to [0504ce8d16].

62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
		length = 0;
		wstring = NULL;

		return self;
	}

	newlen = wcslen(wstr);
	if ((newstr = [self getMem: (newlen + 1) * sizeof(wchar_t)]) == NULL)
		return nil;
	memcpy(newstr, wstr, (newlen + 1) * sizeof(wchar_t));

	if (wstring != NULL)
		[self freeMem: wstring];

	length = newlen;
	wstring = newstr;







|
<







62
63
64
65
66
67
68
69

70
71
72
73
74
75
76
		length = 0;
		wstring = NULL;

		return self;
	}

	newlen = wcslen(wstr);
	newstr = [self getMem: (newlen + 1) * sizeof(wchar_t)];

	memcpy(newstr, wstr, (newlen + 1) * sizeof(wchar_t));

	if (wstring != NULL)
		[self freeMem: wstring];

	length = newlen;
	wstring = newstr;