| 516 | ****************************************************************************/ |
| 517 | |
| 518 | static char *htmlize_text(const char *src) |
| 519 | { |
| 520 | char *dest = g_scratch; |
| 521 | |
| 522 | /* We may get here with the source pointer equal to NULL (or a pointer to |
| 523 | * a NUL string). Return the |
| 524 | * disfavor. |
| 525 | */ |
| 526 | |
| 527 | if (!src || !*src) |
| 528 | { |
| 529 | return NULL; |
| 530 | } |
| 531 | |
| 532 | /* Transfer each character from the source string into the scratch buffer */ |
| 533 | |
| 534 | for (; *src; src++) |
| 535 | { |
| 536 | /* Expand characters as necessary. NOTE: There is no check if the |
| 537 | * HTML-expanded text overflows the g_scratch[] buffer. If you see |
| 538 | * errors, be suspicious. |
| 539 | */ |
| 540 | |
| 541 | dest += htmlize_character(dest, *src); |
| 542 | } |
| 543 | |
| 544 | return g_scratch; |
| 545 | } |
| 546 | |
| 547 | /**************************************************************************** |
| 548 | * Name: htmlize_expression |
no test coverage detected