summaryrefslogtreecommitdiffstatshomepage
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
commit5a0f8634e4ed2c22078afd5c992a17992c7b970f (patch)
treed658e6550cabb9c79fe68a0bfa735ac7f97a6ca1
parent71e1452424a16607e6c6f34c9e2ade17e73775a9 (diff)
downloadmandoc-5a0f8634e4ed2c22078afd5c992a17992c7b970f.tar.gz
mandoc-5a0f8634e4ed2c22078afd5c992a17992c7b970f.tar.zst
mandoc-5a0f8634e4ed2c22078afd5c992a17992c7b970f.zip
bzero() -> memset() (noted by Joerg Sonnenberger).
-rw-r--r--main.c8
-rw-r--r--man.c4
-rw-r--r--man_action.c4
-rw-r--r--mdoc.c4
-rw-r--r--mdoc_strings.c4
-rw-r--r--mdoc_term.c4
-rw-r--r--term.c12
7 files changed, 23 insertions, 17 deletions
diff --git a/main.c b/main.c
index 128f3111..43e8f511 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.50 2009/10/26 15:44:51 kristaps Exp $ */
+/* $Id: main.c,v 1.51 2009/10/27 08:26:11 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 6336f938..3631ef25 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.43 2009/10/26 07:11:06 kristaps Exp $ */
+/* $Id: man.c,v 1.44 2009/10/27 08:26:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 8730892f..a43c72ef 100644
--- a/man_action.c
+++ b/man_action.c
@@ -1,4 +1,4 @@
-/* $Id: man_action.c,v 1.20 2009/10/24 05:45:04 kristaps Exp $ */
+/* $Id: man_action.c,v 1.21 2009/10/27 08:26:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 773a3507..0118c7a8 100644
--- a/mdoc.c
+++ b/mdoc.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc.c,v 1.111 2009/10/26 07:11:07 kristaps Exp $ */
+/* $Id: mdoc.c,v 1.112 2009/10/27 08:26:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 15bf7fea..0d63dac1 100644
--- a/mdoc_strings.c
+++ b/mdoc_strings.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_strings.c,v 1.11 2009/10/26 04:09:46 kristaps Exp $ */
+/* $Id: mdoc_strings.c,v 1.12 2009/10/27 08:26:12 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 a7b6828c..97370bee 100644
--- a/mdoc_term.c
+++ b/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_term.c,v 1.96 2009/10/26 04:09:46 kristaps Exp $ */
+/* $Id: mdoc_term.c,v 1.97 2009/10/27 08:26:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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 0bc46310..b250f02e 100644
--- a/term.c
+++ b/term.c
@@ -1,4 +1,4 @@
-/* $Id: term.c,v 1.114 2009/10/27 08:05:39 kristaps Exp $ */
+/* $Id: term.c,v 1.115 2009/10/27 08:26:12 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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;
/*