diff options
author | Pierre Pfister <ppfister@cisco.com> | 2018-08-20 14:21:07 +0200 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-08-25 00:40:10 +0000 |
commit | ffb3813dd352a8b12fddfa2730dde390f1b92104 (patch) | |
tree | 38fde2ed2709e5f37a0add1ea2cc216d1e85f4ac /src/vlib | |
parent | c9fbd66cdb20c53c6e9cf68ba5ad984be609102f (diff) |
Add int cast to fit '.*' printf expectations
Sometimes, compiler would throw an error:
error: field precision specifier ‘.*’ expects argument of type
‘int’, but argument 5 has type ‘u64 {aka long unsigned int}’
This change adds the requested cast.
Change-Id: I43edeac0ee565a1fcee38b9d2942e49c8dd63116
Signed-off-by: Pierre Pfister <ppfister@cisco.com>
Diffstat (limited to 'src/vlib')
-rw-r--r-- | src/vlib/log.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/vlib/log.c b/src/vlib/log.c index 25d0c4d550c..8e205b9b74a 100644 --- a/src/vlib/log.c +++ b/src/vlib/log.c @@ -199,8 +199,9 @@ syslog: if (use_formatted_log_entry) { syslog (vlib_log_level_to_syslog_priority (level), "%.*s: %.*s", - vec_len (tmp), tmp, - vec_len (s) - (vec_c_string_is_terminated (s) ? 1 : 0), s); + (int) vec_len (tmp), tmp, + (int) (vec_len (s) - + (vec_c_string_is_terminated (s) ? 1 : 0)), s); } else { @@ -209,8 +210,8 @@ syslog: tmp = va_format (tmp, fmt, &va); va_end (va); syslog (vlib_log_level_to_syslog_priority (level), "%.*s", - vec_len (tmp) - (vec_c_string_is_terminated (tmp) ? 1 : 0), - tmp); + (int) (vec_len (tmp) - + (vec_c_string_is_terminated (tmp) ? 1 : 0)), tmp); } vec_free (tmp); } |