Patchwork [2/3] bios: bios_info: strip off trailing newlines

login
register
mail settings
Submitter Colin King
Date May 29, 2012, 1:11 p.m.
Message ID <1338297111-19168-3-git-send-email-colin.king@canonical.com>
Download mbox | patch
Permalink /patch/161741/
State Accepted
Headers show

Comments

Colin King - May 29, 2012, 1:11 p.m.
From: Colin Ian King <colin.king@canonical.com>

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 src/bios/bios_info/bios_info.c |    1 +
 1 file changed, 1 insertion(+)
Alex Hung - May 29, 2012, 2:16 p.m.
On 05/29/2012 09:11 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/bios/bios_info/bios_info.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
> index d6962a1..786052a 100644
> --- a/src/bios/bios_info/bios_info.c
> +++ b/src/bios/bios_info/bios_info.c
> @@ -60,6 +60,7 @@ static int bios_info_test1(fwts_framework *fw)
>   		snprintf(path, sizeof(path), "/sys/class/dmi/id/%s",
>   			bios_info[i].dmi_field);
>   		if ((data = fwts_get(path)) != NULL) {
> +			fwts_chop_newline(data);
>   			fwts_log_info_verbatum(fw, "%-18.18s: %s",
>   				bios_info[i].label, data);
>   			free(data);

Acked-by: Alex Hung <alex.hung@canonical.com>
Keng-Yu Lin - May 31, 2012, 6:57 a.m.
On Tue, May 29, 2012 at 9:11 PM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  src/bios/bios_info/bios_info.c |    1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
> index d6962a1..786052a 100644
> --- a/src/bios/bios_info/bios_info.c
> +++ b/src/bios/bios_info/bios_info.c
> @@ -60,6 +60,7 @@ static int bios_info_test1(fwts_framework *fw)
>                snprintf(path, sizeof(path), "/sys/class/dmi/id/%s",
>                        bios_info[i].dmi_field);
>                if ((data = fwts_get(path)) != NULL) {
> +                       fwts_chop_newline(data);
>                        fwts_log_info_verbatum(fw, "%-18.18s: %s",
>                                bios_info[i].label, data);
>                        free(data);
> --
> 1.7.10
>
Acked-by: Keng-Yu Lin <kengyu@canonical.com>
Ivan Hu - June 1, 2012, 1:42 a.m.
On 05/29/2012 09:11 PM, Colin King wrote:
> From: Colin Ian King<colin.king@canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king@canonical.com>
> ---
>   src/bios/bios_info/bios_info.c |    1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
> index d6962a1..786052a 100644
> --- a/src/bios/bios_info/bios_info.c
> +++ b/src/bios/bios_info/bios_info.c
> @@ -60,6 +60,7 @@ static int bios_info_test1(fwts_framework *fw)
>   		snprintf(path, sizeof(path), "/sys/class/dmi/id/%s",
>   			bios_info[i].dmi_field);
>   		if ((data = fwts_get(path)) != NULL) {
> +			fwts_chop_newline(data);
>   			fwts_log_info_verbatum(fw, "%-18.18s: %s",
>   				bios_info[i].label, data);
>   			free(data);
Acked-by: Ivan Hu<ivan.hu@canonical.com>

Patch

diff --git a/src/bios/bios_info/bios_info.c b/src/bios/bios_info/bios_info.c
index d6962a1..786052a 100644
--- a/src/bios/bios_info/bios_info.c
+++ b/src/bios/bios_info/bios_info.c
@@ -60,6 +60,7 @@  static int bios_info_test1(fwts_framework *fw)
 		snprintf(path, sizeof(path), "/sys/class/dmi/id/%s", 
 			bios_info[i].dmi_field);
 		if ((data = fwts_get(path)) != NULL) {
+			fwts_chop_newline(data);
 			fwts_log_info_verbatum(fw, "%-18.18s: %s",
 				bios_info[i].label, data);
 			free(data);