[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fwts-devel
Subject:    ACK: [PATCH] lib: framework: report warning[s] correctly (LP:#1223736)
From:       IvanHu <ivan.hu () canonical ! com>
Date:       2013-09-18 3:03:56
Message-ID: 5239181C.4010001 () canonical ! com
[Download RAW message or body]

On 09/11/2013 05:08 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> Report "warnings" for more than 1 warning, or "warning" for
> 1 warning. Correcly pluaralise.
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>   src/lib/src/fwts_framework.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_framework.c b/src/lib/src/fwts_framework.c
> index d44fc22..e2b8805 100644
> --- a/src/lib/src/fwts_framework.c
> +++ b/src/lib/src/fwts_framework.c
> @@ -319,7 +319,9 @@ static void fwts_framework_format_results(char *buffer, int buflen, fwts_results
>   		buflen -= n;
>   	}
>   	if ((include_zero_results || (results->warning > 0)) && (buflen > 0)) {
> -		n = snprintf(buffer, buflen, "%s%u warnings", n > 0 ? ", " : "", results->warning);
> +		n = snprintf(buffer, buflen, "%s%u warning%s",
> +			n > 0 ? ", " : "", results->warning,
> +			results->warning > 1 ? "s" : "");
>   		buffer += n;
>   		buflen -= n;
>   	}
>

Acked-by: Ivan Hu <ivan.hu@canonical.com>


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic