The offending line of code is sprintf(address, "%s^%d", address, geo_slot(geoid)); AFAIK, it is a bad idea to have the source and destination address the same. Suggest code rework.