cast strlen() return value to int to remove compiler warning