hdmitx: remove NULL characters of aud_cap
authorKaifu Hu <kaifu.hu@amlogic.com>
Wed, 11 Apr 2018 05:14:43 +0000 (13:14 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Thu, 12 Apr 2018 02:33:54 +0000 (18:33 -0800)
PD#164062: hdmitx: remove NULL characters of aud_cap

remove NULL characters of aud_cap.

Change-Id: Ie82de9879071d87c204058e7b81498fe72eb3a19
Signed-off-by: Kaifu Hu <kaifu.hu@amlogic.com>
drivers/amlogic/media/vout/hdmitx/hdmi_tx_20/hdmi_tx_main.c

index b4954b3..abbbe9a 100644 (file)
@@ -1756,13 +1756,13 @@ static ssize_t show_aud_cap(struct device *dev,
                                pos += snprintf(buf + pos, PAGE_SIZE, "%s/",
                                        aud_sampling_frequency[j+1]);
                }
-               pos += snprintf(buf + pos - 1, PAGE_SIZE, " kHz, ");
+               pos += snprintf(buf + pos - 1, PAGE_SIZE, " kHz, ") - 1;
                for (j = 0; j < 3; j++) {
                        if (pRXCap->RxAudioCap[i].cc3 & (1 << j))
                                pos += snprintf(buf + pos, PAGE_SIZE, "%s/",
                                        aud_sample_size[j+1]);
                }
-               pos += snprintf(buf + pos - 1, PAGE_SIZE, " bit\n");
+               pos += snprintf(buf + pos - 1, PAGE_SIZE, " bit\n") - 1;
        }
 
        return pos;