use strncmp instead of strcmp