[libcamera-devel] [PATCH] libcamera: log: Fix unknown log level representation

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jan 14 17:52:16 CET 2019


Hi Kieran,

Thank you for the patch.

On Monday, 14 January 2019 12:02:56 EET Kieran Bingham wrote:
> Commit 99a3e7bcfb38 ("libcamera: log: Add a LogFatal log level")
> expanded the text representation of the log levels to support the FATAL
> string, but left the default unknown match at four characters.
> 
> This code should never expect to be executed, but for completeness match
> the string lengths by adding an extra character to the result.
> 
> Fixes: 99a3e7bcfb38 ("libcamera: log: Add a LogFatal log level")
> Signed-off-by: Kieran Bingham <kieran.bingham at ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

> ---
>  src/libcamera/log.cpp | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/log.cpp b/src/libcamera/log.cpp
> index 281e31d963f5..9b2ae1bac8c8 100644
> --- a/src/libcamera/log.cpp
> +++ b/src/libcamera/log.cpp
> @@ -77,7 +77,7 @@ static const char *log_severity_name(LogSeverity severity)
> if (static_cast<unsigned int>(severity) < ARRAY_SIZE(names))
>  		return names[severity];
>  	else
> -		return "UNKN";
> +		return "UNKWN";
>  }
> 
>  /**

-- 
Regards,

Laurent Pinchart





More information about the libcamera-devel mailing list