MCPcopy Create free account
hub / github.com/audacity/audacity / output_html_string

Function output_html_string

lib-src/sqlite/shell.c:11797–11826  ·  view source on GitHub ↗

** Output the given string with characters that are special to ** HTML escaped. */

Source from the content-addressed store, hash-verified

11795** HTML escaped.
11796*/
11797static void output_html_string(FILE *out, const char *z){
11798 int i;
11799 if( z==0 ) z = "";
11800 while( *z ){
11801 for(i=0; z[i]
11802 && z[i]!='<'
11803 && z[i]!='&'
11804 && z[i]!='>'
11805 && z[i]!='\"'
11806 && z[i]!='\'';
11807 i++){}
11808 if( i>0 ){
11809 utf8_printf(out,"%.*s",i,z);
11810 }
11811 if( z[i]=='<' ){
11812 raw_printf(out,"&lt;");
11813 }else if( z[i]=='&' ){
11814 raw_printf(out,"&amp;");
11815 }else if( z[i]=='>' ){
11816 raw_printf(out,"&gt;");
11817 }else if( z[i]=='\"' ){
11818 raw_printf(out,"&quot;");
11819 }else if( z[i]=='\'' ){
11820 raw_printf(out,"&#39;");
11821 }else{
11822 break;
11823 }
11824 z += i + 1;
11825 }
11826}
11827
11828/*
11829** If a field contains any character identified by a 1 in the following

Callers 1

shell_callbackFunction · 0.85

Calls 1

utf8_printfFunction · 0.85

Tested by

no test coverage detected