util: Fixes coverity issues in cmod.c
util: Fixes coverity issues in calc.c