Replace Genode::strncpy by Genode::copy_cstring

- Since Genode::strncpy is not 100% compatible with the POSIX
  strncpy function, better use a distinct name.

- Remove bogus return value from the function, easing the potential
  enforcement of mandatory return-value checks later.

Fixes #3752
This commit is contained in:
Norman Feske
2020-05-11 16:10:27 +02:00
committed by Christian Helmuth
parent 0f27d139bd
commit b078224753
64 changed files with 114 additions and 117 deletions

View File

@ -125,8 +125,8 @@ class Log_entry
Log_entry(Genode::Color color, const char *label, const char *log_text, const char *log_attr, int id):
_color(color), _id(id)
{
Genode::strncpy(_label, label, sizeof(_label));
Genode::strncpy(_text, log_text, sizeof(_text));
Genode::copy_cstring(_label, label, sizeof(_label));
Genode::copy_cstring(_text, log_text, sizeof(_text));
_label_len = Genode::strlen(_label);
_text_len = Genode::strlen(_text);