In a setback for gun-control advocates, a state appeals court has barred enforcement of a California law that would require all purchases of ammunition “principally for use” in handguns to be made in person rather than by mail order or on the Internet.

The law, which has been blocked by court orders since 2011, would require buyers of ammunition to be thumb-printed and sellers to keep records of the transactions.

Most types of ammunition are not limited to handguns, but can be used in rifles and other firearms, the Fifth District Court of Appeal said in a 2-1 ruling Wednesday. As a result, the court said, those affected by the law would not have fair notice of whether it applies to their transactions and when they might be at risk of prosecution.

Neither the law nor testimony by experts and gun dealers has provided “a common understanding or objective meaning of the term ‘handgun ammunition,’ ” said Justice Gene Gomes in the majority opinion. The law’s vague wording could lead to inconsistent and unpredictable enforcement, he said, and could make compliance difficult or impossible for mail-order and Internet ammunition .

This really was a no-brainer for the court as the law was unconstitutionally vague. Many “handgun” cartridges are used in rifles, and some “rifle” cartridges are used in handguns.

Next time, California, try having someone who understands firearms write the laws.