ObjFW  Check-in [3bccfadcc1]

Overview
Comment:Fix a very nasty typo in OFMutableDictionary.

This typo would prevent termination in the very rare case that the last
bucket is already used.

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3bccfadcc1f50f8b4d7a2c79e1d04e393aca29bb257c9b6cad12c2045cbb52e9
User & Date: js on 2010-06-01 18:00:12
Other Links: manifest | tags
Context
2010-06-06
20:04
Support for namespaces in OFXMLElement and OFXMLParser. HUGE diff! check-in: e8c8d5a894 user: js tags: trunk
2010-06-01
18:00
Fix a very nasty typo in OFMutableDictionary. check-in: 3bccfadcc1 user: js tags: trunk
2010-05-27
15:39
Add environment to OFApplication. check-in: 62bef06751 user: js tags: trunk
Changes

Modified src/OFMutableDictionary.m from [5339feda90] to [c74680827d].

57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
			for (; j < last && newdata[j] != NULL; j++);

			/* In case the last bucket is already used */
			if (j >= last) {
				last = data[i]->hash & (newsize - 1);

				for (j = 0; j < last &&
				    newdata[j] != NULL; i++);
			}

			if (j >= last) {
				[self freeMemory: newdata];
				@throw [OFOutOfRangeException
				    newWithClass: isa];
			}







|







57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
			for (; j < last && newdata[j] != NULL; j++);

			/* In case the last bucket is already used */
			if (j >= last) {
				last = data[i]->hash & (newsize - 1);

				for (j = 0; j < last &&
				    newdata[j] != NULL; j++);
			}

			if (j >= last) {
				[self freeMemory: newdata];
				@throw [OFOutOfRangeException
				    newWithClass: isa];
			}