summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org>2020-10-08 21:49:40 +0300
committerSergey Poznyakoff <gray@gnu.org>2020-10-08 21:49:40 +0300
commiteacef7351b01c2e784b4538102eb371289e5aa54 (patch)
treeaf9f12fa085169a7da991d37555298dd9258f67f
parent4fb2326a4ac0e6f45c21f7651b1c87317567fd82 (diff)
downloadgdbm-eacef7351b01c2e784b4538102eb371289e5aa54.tar.gz
Bugfixes.
* doc/gdbm.texi: Fix the description of a sample content structure. * src/datconv.c (datum_scan_notag): Proceed to the next kvpair only for segments of the FDEF_FLD type.
-rw-r--r--doc/gdbm.texi4
-rw-r--r--src/datconv.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/doc/gdbm.texi b/doc/gdbm.texi
index e81f993..1b63d0b 100644
--- a/doc/gdbm.texi
+++ b/doc/gdbm.texi
@@ -2641,8 +2641,8 @@ define content @{
@noindent
This defines a structure consisting of three members: an integer
-@code{status}, an array of 8 bytes @code{id}, and a null-terminated
-string @code{name}. Notice the @code{pad} statement: it allows to
+@code{status}, an array of 3 bytes @code{id}, and an array of
+bytes @code{name}. Notice the @code{pad} statement: it allows to
introduce padding between structure members. Another useful statement
is @code{offset}: it specifies that the member following it begins at
the given offset in the structure. Assuming the size of @code{int} is
diff --git a/src/datconv.c b/src/datconv.c
index f5b893f..8b3b65c 100644
--- a/src/datconv.c
+++ b/src/datconv.c
@@ -321,7 +321,7 @@ datum_scan_notag (datum *dat, struct dsegm *ds, struct kvpair *kv)
memset (&xd, 0, sizeof (xd));
- for (; err == 0 && ds && kv; ds = ds->next, kv = kv->next)
+ for (; err == 0 && ds && kv; ds = ds->next)
{
if (kv->key)
{
@@ -340,7 +340,7 @@ datum_scan_notag (datum *dat, struct dsegm *ds, struct kvpair *kv)
if (kv->type == KV_STRING && ds->v.field.dim > 1)
{
/* If a char[] value was supplied as a quoted string.
- convert it it list for further processing */
+ convert it to list for further processing */
if (ds->v.field.type->size == 1)
{
struct slist *head = slist_new_l (kv->val.s, 1);
@@ -380,7 +380,8 @@ datum_scan_notag (datum *dat, struct dsegm *ds, struct kvpair *kv)
lerror (&kv->loc, "surplus initializers ignored");
err = 1;
}
- }
+ }
+ kv = kv->next;
break;
case FDEF_OFF: