fixed printf with len usage