params is only ever set to current cmd which is never the right thing maybe get rid of params and just use cmd ugly but efficient or make  update dns  a const and let the compiler count for us and optimize out the strlen ie const char const update dns cmd update dns then in code set servers cmd strlen update dns cmd 