Several cleanups
Summary:
- No cppcheck warnings anymore
- Use snprintf everywhere
- Avoid pointless multiplication with sizeof(char)
- Avoid memory leaks
Test Plan: Still builds, works the same as before.
Reviewers: Plasma
Subscribers: plasma-devel
Tags: Plasma
Differential Revision: https://phabricator.kde.org/D7123