summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-27 08:26:11 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-27 08:26:11 +0000
commit7e736e832ab3af50731a6052e3a35a687fa8b3a4 (patch)
tree5cf3201ebb4ef4ba706270a36400689b8f57d9ce
parent1a72827ba0c676daa9f8e7727da2668825b503a2 (diff)
downloadmandoc-7e736e832ab3af50731a6052e3a35a687fa8b3a4.tar.gz
bzero() -> memset() (noted by Joerg Sonnenberger).
-rw-r--r--main.c6
-rw-r--r--man.c2
-rw-r--r--man_action.c2
-rw-r--r--mdoc.c2
-rw-r--r--mdoc_strings.c2
-rw-r--r--mdoc_term.c2
-rw-r--r--term.c10
7 files changed, 16 insertions, 10 deletions
diff --git a/main.c b/main.c
index 2fa117ff..fe6c795f 100644
--- a/main.c
+++ b/main.c
@@ -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;
diff --git a/man.c b/man.c
index 7120f06e..d8d643c3 100644
--- a/man.c
+++ b/man.c
@@ -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));
diff --git a/mdoc.c b/mdoc.c
index 92d5a195..85fda665 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -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) {
diff --git a/term.c b/term.c
index e6085a86..6f929284 100644
--- a/term.c
+++ b/term.c
@@ -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;
/*