UTF8API_EXPORT void uFixAmpersandChars_v2(const char * src,string_base & out) { out.reset(); while(*src) { if (*src=='&') { out.add_string("&&"); src++; } else out.add_byte(*(src++)); } }
static void fix_ampersand(const char * src,string_base & out) { unsigned ptr = 0; while(src[ptr]) { if (src[ptr]=='&') { out.add_string("&&"); ptr++; while(src[ptr]=='&') { out.add_string("&&"); ptr++; } } else out.add_byte(src[ptr++]); } }