Fixed printf detection routine