warnings: fix strncpy warnings
GCC is getting smarter and detects that we're not copying the NUL terminator over.
There are two approaches to fixing the warning:
- where code is already a bit more complicated, just use
std::string
instead of C-style string manipulations; and - where we were doing
strncpy(dest, src, strlen(src))
, just usestrcpy
instead since the destination sizes are made based on the size ofsrc
anyways.
This fixes warnings which have appeared on megas
due to its Fedora 28 update.
Edited by Ben Boeckel