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
 // Try to find input/output with certain name, return 0 on not found, pos + 1 is found
306
 // Try to find input/output with certain name, return 0 on not found, pos + 1 is found
307
 static int search_video_output_name(struct videohub_data *d, char *name) {
307
 static int search_video_output_name(struct videohub_data *d, char *name) {
308
 	unsigned int i;
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
 		if (streq(name, d->outputs[i].name)) {
310
 		if (streq(name, d->outputs[i].name)) {
311
 			return i + 1;
311
 			return i + 1;
312
 		}
312
 		}
316
 
316
 
317
 static int search_video_input_name(struct videohub_data *d, char *name) {
317
 static int search_video_input_name(struct videohub_data *d, char *name) {
318
 	unsigned int i;
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
 		if (streq(name, d->inputs[i].name)) {
320
 		if (streq(name, d->inputs[i].name)) {
321
 			return i + 1;
321
 			return i + 1;
322
 		}
322
 		}

Loading…
Cancel
Save