c snippet else if bug