-rw-r--r-- | html.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -44,9 +44,9 @@ void htmlf(const char *format, ...) void html_txt(char *txt) { char *t = txt; - while(*t){ + while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='&') { *t = '\0'; html(txt); @@ -67,9 +67,9 @@ void html_txt(char *txt) void html_ntxt(int len, char *txt) { char *t = txt; - while(*t && len--){ + while(t && *t && len--){ int c = *t; if (c=='<' || c=='>' || c=='&') { *t = '\0'; html(txt); @@ -96,9 +96,9 @@ void html_ntxt(int len, char *txt) void html_attr(char *txt) { char *t = txt; - while(*t){ + while(t && *t){ int c = *t; if (c=='<' || c=='>' || c=='\'') { *t = '\0'; html(txt); @@ -154,5 +154,4 @@ void html_filemode(unsigned short mode) html_fileperm(mode >> 6); html_fileperm(mode >> 3); html_fileperm(mode); } - |