logger: fix buffer overflow and bad trimming
logger: fix buffer overflow and bad trimming

Signed-off-by: Alejandro Mery <cdfd70a51550235bbe9d06a3549b54fb5429c504@linux.com>

sancus-project/sancus-core,sancus-project/sancus-core,sancus-project/sancus-core