summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--html.c14
-rw-r--r--term.c3
2 files changed, 7 insertions, 10 deletions
diff --git a/html.c b/html.c
index 7a087072..041e1061 100644
--- a/html.c
+++ b/html.c
@@ -670,26 +670,24 @@ html_idcat(char *dst, const char *src, int sz)
for (i = 0; *dst != '\0' && i < sz - 1; dst++, i++)
/* Jump to end. */ ;
- for ( ; *src != '\0' && i < sz - 1; src++, i++) {
+ for ( ; *src != '\0' && i < sz - 1; src++, i++, dst++) {
if (isalnum((u_char)*src)) {
- *dst++ = *src;
+ *dst = *src;
continue;
}
switch (*src) {
case (';'):
- *dst++ = ';';
+ *dst = ';';
break;
case ('-'):
- *dst++ = '-';
+ *dst = '-';
break;
case (':'):
- *dst++ = ':';
+ *dst = ':';
break;
- case ('_'):
- /* FALLTHROUGH */
default:
- *dst++ = '_';
+ *dst = '_';
break;
}
}
diff --git a/term.c b/term.c
index 6f929284..3fdb4cc1 100644
--- a/term.c
+++ b/term.c
@@ -77,9 +77,8 @@ term_alloc(enum termenc enc)
{
struct termp *p;
- if (NULL == (p = malloc(sizeof(struct termp))))
+ if (NULL == (p = calloc(1, sizeof(struct termp))))
return(NULL);
- memset(p, 0, sizeof(struct termp));
p->maxrmargin = 78;
p->enc = enc;
return(p);