sometimes the length of a string takes some time to settle, so to avoid race conditions you should always call strlen twice and check that the results match