mirror of
https://github.com/genodelabs/genode.git
synced 2025-06-19 23:53:55 +00: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
@ -77,7 +77,7 @@ Platform_thread::Registry &Platform_thread::_registry()
|
||||
Platform_thread::Platform_thread(size_t, const char *name, unsigned,
|
||||
Affinity::Location, addr_t)
|
||||
{
|
||||
strncpy(_name, name, min(sizeof(_name), strlen(name) + 1));
|
||||
copy_cstring(_name, name, min(sizeof(_name), strlen(name) + 1));
|
||||
|
||||
_registry().insert(this);
|
||||
}
|
||||
|
@ -41,7 +41,7 @@ Linux_dataspace::Filename Dataspace_component::_file_name(const char *args)
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
strncpy(fname.buf, label.last_element().string(), sizeof(fname.buf));
|
||||
copy_cstring(fname.buf, label.last_element().string(), sizeof(fname.buf));
|
||||
|
||||
/* only files inside the current working directory are allowed */
|
||||
for (const char *c = fname.buf; *c; ++c)
|
||||
|
@ -41,7 +41,7 @@ Linux_dataspace::Filename Dataspace_component::_file_name(const char *args)
|
||||
throw Service_denied();
|
||||
}
|
||||
|
||||
strncpy(fname.buf, label.last_element().string(), sizeof(fname.buf));
|
||||
copy_cstring(fname.buf, label.last_element().string(), sizeof(fname.buf));
|
||||
|
||||
/* only files inside the current working directory are allowed */
|
||||
for (const char *c = fname.buf; *c; ++c)
|
||||
|
Reference in New Issue
Block a user