projects
/
citadel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
* html_to_ascii(): don't buffer underrun while checking whether we should append...
[citadel.git]
/
libcitadel
/
lib
/
html_to_ascii.c
diff --git
a/libcitadel/lib/html_to_ascii.c
b/libcitadel/lib/html_to_ascii.c
index 90d1103f56e5dbfc629c4c2ca52268978d720b0a..86cbdedeed4574c0fb0f8e67de99354e06644f5e 100644
(file)
--- a/
libcitadel/lib/html_to_ascii.c
+++ b/
libcitadel/lib/html_to_ascii.c
@@
-570,7
+570,7
@@
char *html_to_ascii(char *inputmsg, int msglen, int screenwidth, int do_citaform
--output_len;
}
- if (
outptr[output_len-1] != '\n'
) {
+ if (
(output_len > 0) && (outptr[output_len-1] != '\n')
) {
strcat(outptr, "\n");
++output_len;
}