ObjFW  Diff

Differences From Artifact [88137d01a8]:

To Artifact [22aa3a0709]:


169
170
171
172
173
174
175

176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193

194
195
196
197
198
199
200
201
202
203
204
205
206
207
208

209
210
211
212
213
214
215
	}
	@try {
		network = [networkString unsignedLongLongValueWithBase: 0];
	} @catch (OFInvalidFormatException *e) {
		[OFStdErr writeFormat: @"%@: Invalid format for --network!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];

	}
	if (network > UINT16_MAX) {
		[OFStdErr writeFormat: @"%@: --network out of range!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
	}

	if (nodeString == nil) {
		[OFStdErr writeFormat: @"%@: --node not specified!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
	}
	@try {
		node = [nodeString unsignedLongLongValueWithBase: 0];
	} @catch (OFInvalidFormatException *e) {
		[OFStdErr writeFormat: @"%@: Invalid format for --node!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];

	}
	if (node > UINT8_MAX) {
		[OFStdErr writeFormat: @"%@: --node out of range!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
	}

	if (phaseString != nil) {
		@try {
			phase = [phaseString unsignedLongLongValueWithBase: 0];
		} @catch (OFInvalidFormatException *e) {
			[OFStdErr writeFormat:
			    @"%@: Invalid format for "@"--phase!\n",
			    [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];

		}

		if (phase > 2) {
			[OFStdErr writeFormat: @"%@: --phase out of range!\n",
					       [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];
		}







>


















>















>







169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
	}
	@try {
		network = [networkString unsignedLongLongValueWithBase: 0];
	} @catch (OFInvalidFormatException *e) {
		[OFStdErr writeFormat: @"%@: Invalid format for --network!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
		return;
	}
	if (network > UINT16_MAX) {
		[OFStdErr writeFormat: @"%@: --network out of range!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
	}

	if (nodeString == nil) {
		[OFStdErr writeFormat: @"%@: --node not specified!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
	}
	@try {
		node = [nodeString unsignedLongLongValueWithBase: 0];
	} @catch (OFInvalidFormatException *e) {
		[OFStdErr writeFormat: @"%@: Invalid format for --node!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
		return;
	}
	if (node > UINT8_MAX) {
		[OFStdErr writeFormat: @"%@: --node out of range!\n",
				       [OFApplication programName]];
		[OFApplication terminateWithStatus: 1];
	}

	if (phaseString != nil) {
		@try {
			phase = [phaseString unsignedLongLongValueWithBase: 0];
		} @catch (OFInvalidFormatException *e) {
			[OFStdErr writeFormat:
			    @"%@: Invalid format for "@"--phase!\n",
			    [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];
			return;
		}

		if (phase > 2) {
			[OFStdErr writeFormat: @"%@: --phase out of range!\n",
					       [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];
		}
231
232
233
234
235
236
237

238
239
240
241
242
243
244
			rangeEnd = [[rangeArray objectAtIndex: 1]
			    unsignedLongLongValueWithBase: 0];
		} @catch (OFInvalidFormatException *e) {
			[OFStdErr writeFormat:
			    @"%@: Invalid format for --range!\n",
			    [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];

		}

		if (rangeStart > UINT16_MAX || rangeEnd > UINT16_MAX) {
			[OFStdErr writeFormat: @"%@: --range out of range!\n",
					       [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];
		}







>







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
			rangeEnd = [[rangeArray objectAtIndex: 1]
			    unsignedLongLongValueWithBase: 0];
		} @catch (OFInvalidFormatException *e) {
			[OFStdErr writeFormat:
			    @"%@: Invalid format for --range!\n",
			    [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];
			return;
		}

		if (rangeStart > UINT16_MAX || rangeEnd > UINT16_MAX) {
			[OFStdErr writeFormat: @"%@: --range out of range!\n",
					       [OFApplication programName]];
			[OFApplication terminateWithStatus: 1];
		}