static size_t utf8dec(char *dst, char *src, u8 cpy2src) { size_t j = 0; unsigned char c; for(size_t i = 0; src[i]; i++, j++) { c = (unsigned char)src[i]; if( (c & 0x80) == 0 ) { dst[j] = c; } else if( (c & 0xE0) == 0xC0 ) { dst[j] = ((c & 0x1F)<<6) | (src[i+1] & 0x3F); i+=1; } else if( (c & 0xF0) == 0xE0 ) { dst[j] = ((c & 0xF)<<12); dst[j] |= ((src[i+1]
| 312 | } |
| 313 | */ |
| 314 | static void add_url(char *body, const char *prefix, const char *url, const char *sufix) |
| 315 | { |
| 316 | if(!body) return; |
| 317 | |
| 318 | if(prefix) concat(body, prefix); |
| 319 | if(url) concat(body, url); |
| 320 | if(sufix) concat(body, sufix); |
| 321 | } |
| 322 | |
| 323 | static size_t add_html(u8 id, int value, char *buffer, char *data) |
| 324 | { |
no test coverage detected