]>
diplodocus.org Git - nmh/blob - sbr/seq_bits.c
3 * seq_bits.c -- return the snprintb() string for a sequence
5 * This code is Copyright (c) 2002, by the authors of nmh. See the
6 * COPYRIGHT file in the root directory of the nmh distribution for
7 * complete copyright information.
14 seq_bits (struct msgs
*mp
)
18 static char buffer
[BUFSIZ
];
20 strncpy (buffer
, MBITS
, sizeof(buffer
));
22 for (i
= 0; i
< svector_size (mp
->msgattrs
); i
++) {
23 len
= strlen (buffer
);
24 snprintf (buffer
+ len
, sizeof(buffer
) - len
,
25 "%c%s", FFATTRSLOT
+ 1 + (int) i
,
26 svector_at (mp
->msgattrs
, i
));
28 * seq_bits() is used by seq_printdebug(), which passes an
29 * unsigned int bit vector to snprintb(). So limit the
30 * size of the return value accordingly. Even worse,
31 * snprintb() only uses characters up through ASCII space
32 * as the delimiter (the %c character above). So limit
35 if ((int) i
== ' ' - FFATTRSLOT
- 1) break;