| 462 | ****************************************************************************/ |
| 463 | |
| 464 | static int htmlize_character(char *dest, char ch) |
| 465 | { |
| 466 | const char *str; |
| 467 | |
| 468 | /* Transfer the character from into the destination buffer, perform the |
| 469 | * conversion only if the character is one of the special characters. |
| 470 | */ |
| 471 | |
| 472 | str = NULL; |
| 473 | |
| 474 | switch (ch) |
| 475 | { |
| 476 | case '"': |
| 477 | str = """; |
| 478 | break; |
| 479 | |
| 480 | case '\'': |
| 481 | str = "'"; |
| 482 | break; |
| 483 | |
| 484 | case '&': |
| 485 | str = "&"; |
| 486 | break; |
| 487 | |
| 488 | case '<': |
| 489 | str = "<"; |
| 490 | break; |
| 491 | |
| 492 | case '>': |
| 493 | str = ">"; |
| 494 | break; |
| 495 | |
| 496 | default: |
| 497 | *dest++ = ch; |
| 498 | *dest = '\0'; |
| 499 | return 1; |
| 500 | } |
| 501 | |
| 502 | /* Transfer a string */ |
| 503 | |
| 504 | *dest = '\0'; |
| 505 | strcat(dest, str); |
| 506 | return strlen(str); |
| 507 | } |
| 508 | |
| 509 | /**************************************************************************** |
| 510 | * Name: htmlize_text |
no test coverage detected