mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
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:
committed by
Christian Helmuth
parent
0f27d139bd
commit
b078224753
@@ -102,7 +102,7 @@ class Scout::Canvas : public Canvas_base
|
||||
void draw_string(int x, int y, Font *font, Color color, char const *str, int len) override
|
||||
{
|
||||
char buf[len + 1];
|
||||
Genode::strncpy(buf, str, len + 1);
|
||||
Genode::copy_cstring(buf, str, len + 1);
|
||||
Text_painter::paint(_surface, Text_painter::Position(x, y), *font, color, buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user