Browse Source

cmd: outputs and inputs arrays are always big enough to holds num_video_{inputs,outputs}.

Georgi Chorbadzhiyski 9 years ago
parent
commit
925385a527
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      cmd.c

+ 2
- 2
cmd.c View File

@@ -306,7 +306,7 @@ int parse_text_buffer(struct videohub_data *data, char *cmd_buffer) {
306 306
 // Try to find input/output with certain name, return 0 on not found, pos + 1 is found
307 307
 static int search_video_output_name(struct videohub_data *d, char *name) {
308 308
 	unsigned int i;
309
-	for(i = 0; i < MIN(d->device.num_video_outputs, ARRAY_SIZE(d->outputs)); i++) {
309
+	for(i = 0; i < d->device.num_video_outputs; i++) {
310 310
 		if (streq(name, d->outputs[i].name)) {
311 311
 			return i + 1;
312 312
 		}
@@ -316,7 +316,7 @@ static int search_video_output_name(struct videohub_data *d, char *name) {
316 316
 
317 317
 static int search_video_input_name(struct videohub_data *d, char *name) {
318 318
 	unsigned int i;
319
-	for(i = 0; i < MIN(d->device.num_video_inputs, ARRAY_SIZE(d->inputs)); i++) {
319
+	for(i = 0; i < d->device.num_video_inputs; i++) {
320 320
 		if (streq(name, d->inputs[i].name)) {
321 321
 			return i + 1;
322 322
 		}

Loading…
Cancel
Save