remove the duplicate strnlen and strndup

Signed-off-by: Simon Gomizelj <simongmzlj@gmail.com>