ACK: [PATCH 04/27] lib: fwts_log: remove const arg in fwts_log_set_field_filter
ivanhu
ivan.hu at canonical.com
Thu Aug 16 09:12:21 UTC 2018
On 08/15/2018 09:11 PM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Argument str should not be const as strtok_r can modify it; remove
> the const.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/include/fwts_log.h | 2 +-
> src/lib/src/fwts_log.c | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/lib/include/fwts_log.h b/src/lib/include/fwts_log.h
> index 0ddcf76f..e9da27b3 100644
> --- a/src/lib/include/fwts_log.h
> +++ b/src/lib/include/fwts_log.h
> @@ -129,7 +129,7 @@ int fwts_log_printf(const fwts_framework *fw, const fwts_log_field field,
> __attribute__((format(printf, 7, 8)));
> void fwts_log_newline(fwts_log *log);
> void fwts_log_underline(fwts_log *log, const int ch);
> -void fwts_log_set_field_filter(const char *str);
> +void fwts_log_set_field_filter(char *str);
> int fwts_log_set_owner(fwts_log *log, const char *owner);
> void fwts_log_set_format(const char *str);
> void fwts_log_print_fields(void);
> diff --git a/src/lib/src/fwts_log.c b/src/lib/src/fwts_log.c
> index 32406f30..5a7151ec 100644
> --- a/src/lib/src/fwts_log.c
> +++ b/src/lib/src/fwts_log.c
> @@ -274,7 +274,7 @@ void fwts_log_filter_unset_field(const fwts_log_field filter)
> * list of field names. ~ or ^ prefix to a field name
> * clears a bit.
> */
> -void fwts_log_set_field_filter(const char *str)
> +void fwts_log_set_field_filter(char *str)
> {
> char *saveptr;
> fwts_log_field field;
> @@ -282,7 +282,7 @@ void fwts_log_set_field_filter(const char *str)
> for (;; str=NULL) {
> char *token;
>
> - if ((token = strtok_r((char*)str, ",|", &saveptr)) == NULL)
> + if ((token = strtok_r(str, ",|", &saveptr)) == NULL)
> break;
> if (*token == '^' || *token == '~') {
> field = fwts_log_str_to_field(token+1);
Acked-by: Ivan Hu <ivan.hu at canonical.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/823f303f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/fwts-devel/attachments/20180816/823f303f/attachment.sig>
More information about the fwts-devel
mailing list