projects
/
collection4.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
src/utils_cgi.c: Fix minor problems with the HTML escape functions.
[collection4.git]
/
src
/
utils_cgi.c
diff --git
a/src/utils_cgi.c
b/src/utils_cgi.c
index
9efa01f
..
fb9a1fb
100644
(file)
--- a/
src/utils_cgi.c
+++ b/
src/utils_cgi.c
@@
-328,7
+328,7
@@
char *html_escape_copy (char *dest, const char *src, size_t n) /* {{{ */
break;
}
- return (
src
);
+ return (
dest
);
} /* }}} char *html_escape_copy */
#undef COPY_ENTITY
@@
-347,6
+347,9
@@
char *html_escape (const char *string) /* {{{ */
{
char buffer[4096];
+ if (string == NULL)
+ return (NULL);
+
html_escape_copy (buffer, string, sizeof (buffer));
return (strdup (buffer));