! \brief * replace &#xx; with ascii character */
| 114 | * replace &#xx; with ascii character |
| 115 | */ |
| 116 | int unescape_xml(char *dst, const char *src, int src_len) |
| 117 | { |
| 118 | int i, j; |
| 119 | |
| 120 | if(dst==0 || src==0 || src_len<=0) |
| 121 | return 0; |
| 122 | j = 0; |
| 123 | i = 0; |
| 124 | while(i<src_len) |
| 125 | { |
| 126 | if(src[i]=='&' && i+4<src_len && src[i+1]=='#' && src[i+4]==';' && |
| 127 | src[i+2]>='0' && src[i+2]<='9' && src[i+3]>='0' && src[i+3]<='9') { |
| 128 | dst[j++] = (src[i+2]-'0')*10 + src[i+3] - '0'; |
| 129 | i += 5; |
| 130 | } else { |
| 131 | dst[j++] = src[i++]; |
| 132 | } |
| 133 | } |
| 134 | return j; |
| 135 | } |
| 136 | |
| 137 | /*! \brief Compute MD5 checksum */ |
| 138 | void compute_md5(char *dst, const char *src, int src_len) |
no outgoing calls
no test coverage detected