Unidiff1 files changed, 3 insertions, 4 deletions
|
diff --git a/html.c b/html.c index 957b326..3a5d28d 100644 --- a/ html.c+++ b/ html.c |
|
@@ -44,9 +44,9 @@ void htmlf(const char *format, ...) |
44 | |
44 | |
45 | void html_txt(char *txt) |
45 | void html_txt(char *txt) |
46 | { |
46 | { |
47 | char *t = txt; |
47 | char *t = txt; |
48 | while(*t){ |
48 | while(t && *t){ |
49 | int c = *t; |
49 | int c = *t; |
50 | if (c=='<' || c=='>' || c=='&') { |
50 | if (c=='<' || c=='>' || c=='&') { |
51 | *t = '\0'; |
51 | *t = '\0'; |
52 | html(txt); |
52 | html(txt); |
@@ -67,9 +67,9 @@ void html_txt(char *txt) |
67 | |
67 | |
68 | void html_ntxt(int len, char *txt) |
68 | void html_ntxt(int len, char *txt) |
69 | { |
69 | { |
70 | char *t = txt; |
70 | char *t = txt; |
71 | while(*t && len--){ |
71 | while(t && *t && len--){ |
72 | int c = *t; |
72 | int c = *t; |
73 | if (c=='<' || c=='>' || c=='&') { |
73 | if (c=='<' || c=='>' || c=='&') { |
74 | *t = '\0'; |
74 | *t = '\0'; |
75 | html(txt); |
75 | html(txt); |
@@ -96,9 +96,9 @@ void html_ntxt(int len, char *txt) |
96 | |
96 | |
97 | void html_attr(char *txt) |
97 | void html_attr(char *txt) |
98 | { |
98 | { |
99 | char *t = txt; |
99 | char *t = txt; |
100 | while(*t){ |
100 | while(t && *t){ |
101 | int c = *t; |
101 | int c = *t; |
102 | if (c=='<' || c=='>' || c=='\'') { |
102 | if (c=='<' || c=='>' || c=='\'') { |
103 | *t = '\0'; |
103 | *t = '\0'; |
104 | html(txt); |
104 | html(txt); |
@@ -154,5 +154,4 @@ void html_filemode(unsigned short mode) |
154 | html_fileperm(mode >> 6); |
154 | html_fileperm(mode >> 6); |
155 | html_fileperm(mode >> 3); |
155 | html_fileperm(mode >> 3); |
156 | html_fileperm(mode); |
156 | html_fileperm(mode); |
157 | } |
157 | } |
158 | |
| |
|