South Carolina's highest court has ruled that police did not violate the constitutional rights of a man they stopped on suspicion of dealing drugs.