Browse Source

display: Do not print table titles if there are no inputs/outputs.

Georgi Chorbadzhiyski 9 years ago
parent
commit
cb86ee6533
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      display.c

+ 4
- 0
display.c View File

@@ -46,6 +46,8 @@ void print_device_info(struct videohub_data *d) {
46 46
 
47 47
 void print_device_video_inputs(struct videohub_data *d) {
48 48
 	unsigned int i, len = 33;
49
+	if (!d->device.num_video_inputs)
50
+		return;
49 51
 	printf("Video inputs\n");
50 52
 	printf_line(len);
51 53
 	printf("  | ## | %-24s |\n", "Video input name");
@@ -62,6 +64,8 @@ void print_device_video_inputs(struct videohub_data *d) {
62 64
 
63 65
 void print_device_video_outputs(struct videohub_data *d) {
64 66
 	unsigned int i, len = 64;
67
+	if (!d->device.num_video_outputs)
68
+		return;
65 69
 	printf("Video outputs\n");
66 70
 	printf_line(len);
67 71
 	printf("  | ## | x | %-24s | %-24s |\n", "Video output name", "Connected video input");

Loading…
Cancel
Save