ACK: [PATCH] lib: framework: report warning[s] correctly (LP:#1223736)

IvanHu ivan.hu at canonical.com
Wed Sep 18 03:03:56 UTC 2013


On 09/11/2013 05:08 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Report "warnings" for more than 1 warning, or "warning" for
> 1 warning. Correcly pluaralise.
>
> Signed-off-by: Colin Ian King <colin.king at 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 at canonical.com>



More information about the fwts-devel mailing list