shared: util - use nicer idiom to silence Coverity

Suggested by Zbigniew.