Restored change by Axel for strlen replacement
(cherry picked from commit 4f78719cf5f7a19f361392c2ea79ca1d81f47234)