diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-27 08:26:11 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2009-10-27 08:26:11 +0000 |
commit | 7e736e832ab3af50731a6052e3a35a687fa8b3a4 (patch) | |
tree | 5cf3201ebb4ef4ba706270a36400689b8f57d9ce | |
parent | 1a72827ba0c676daa9f8e7727da2668825b503a2 (diff) | |
download | mandoc-7e736e832ab3af50731a6052e3a35a687fa8b3a4.tar.gz |
bzero() -> memset() (noted by Joerg Sonnenberger).
-rw-r--r-- | main.c | 6 | ||||
-rw-r--r-- | man.c | 2 | ||||
-rw-r--r-- | man_action.c | 2 | ||||
-rw-r--r-- | mdoc.c | 2 | ||||
-rw-r--r-- | mdoc_strings.c | 2 | ||||
-rw-r--r-- | mdoc_term.c | 2 | ||||
-rw-r--r-- | term.c | 10 |
7 files changed, 16 insertions, 10 deletions
@@ -119,7 +119,7 @@ main(int argc, char *argv[]) struct buf ln, blk; struct curparse curp; - bzero(&curp, sizeof(struct curparse)); + memset(&curp, 0, sizeof(struct curparse)); curp.inttype = INTT_AUTO; curp.outtype = OUTT_ASCII; @@ -158,8 +158,8 @@ main(int argc, char *argv[]) argc -= optind; argv += optind; - bzero(&ln, sizeof(struct buf)); - bzero(&blk, sizeof(struct buf)); + memset(&ln, 0, sizeof(struct buf)); + memset(&blk, 0, sizeof(struct buf)); rc = 1; @@ -175,7 +175,7 @@ static int man_alloc1(struct man *m) { - bzero(&m->meta, sizeof(struct man_meta)); + memset(&m->meta, 0, sizeof(struct man_meta)); m->flags = 0; m->last = calloc(1, sizeof(struct man_node)); if (NULL == m->last) diff --git a/man_action.c b/man_action.c index 6e608310..e0e4139e 100644 --- a/man_action.c +++ b/man_action.c @@ -208,7 +208,7 @@ man_atotime(const char *p) struct tm tm; char *pp; - bzero(&tm, sizeof(struct tm)); + memset(&tm, 0, sizeof(struct tm)); if ((pp = strptime(p, "%b %d %Y", &tm)) && 0 == *pp) return(mktime(&tm)); @@ -198,7 +198,7 @@ static int mdoc_alloc1(struct mdoc *mdoc) { - bzero(&mdoc->meta, sizeof(struct mdoc_meta)); + memset(&mdoc->meta, 0, sizeof(struct mdoc_meta)); mdoc->flags = 0; mdoc->lastnamed = mdoc->lastsec = SEC_NONE; mdoc->last = calloc(1, sizeof(struct mdoc_node)); diff --git a/mdoc_strings.c b/mdoc_strings.c index 5ac30111..1962a6ca 100644 --- a/mdoc_strings.c +++ b/mdoc_strings.c @@ -131,7 +131,7 @@ mdoc_atotime(const char *p) struct tm tm; char *pp; - bzero(&tm, sizeof(struct tm)); + memset(&tm, 0, sizeof(struct tm)); if (0 == strcmp(p, "$" "Mdocdate$")) return(time(NULL)); diff --git a/mdoc_term.c b/mdoc_term.c index f39265c5..f503bd4c 100644 --- a/mdoc_term.c +++ b/mdoc_term.c @@ -315,7 +315,7 @@ print_node(DECL_ARGS) bold = p->bold; under = p->under; - bzero(&npair, sizeof(struct termpair)); + memset(&npair, 0, sizeof(struct termpair)); npair.ppair = pair; if (MDOC_TEXT != n->type) { @@ -79,7 +79,7 @@ term_alloc(enum termenc enc) if (NULL == (p = malloc(sizeof(struct termp)))) return(NULL); - bzero(p, sizeof(struct termp)); + memset(p, 0, sizeof(struct termp)); p->maxrmargin = 78; p->enc = enc; return(p); @@ -139,7 +139,7 @@ term_flushln(struct termp *p) * First, establish the maximum columns of "visible" content. * This is usually the difference between the right-margin and * an indentation, but can be, for tagged lists or columns, a - * small set of values. + * small set of values. */ assert(p->offset < p->rmargin); @@ -150,6 +150,12 @@ term_flushln(struct termp *p) 0 : p->maxrmargin - p->offset - overstep; bp = TERMP_NOBREAK & p->flags ? mmax : maxvis; + + /* + * FIXME: if bp is zero, we still output the first word before + * breaking the line. + */ + vis = 0; /* |