Add/update copyright notice in all source code files.
[mmh] / sbr / seq_bits.c
1
2 /*
3  * seq_bits.c -- return the snprintb() string for a sequence
4  *
5  * $Id$
6  *
7  * This code is Copyright (c) 2002, by the authors of nmh.  See the
8  * COPYRIGHT file in the root directory of the nmh distribution for
9  * complete copyright information.
10  */
11
12 #include <h/mh.h>
13
14
15 char *
16 seq_bits (struct msgs *mp)
17 {
18     int i;
19     size_t len;
20     static char buffer[BUFSIZ];
21
22     strncpy (buffer, MBITS, sizeof(buffer));
23
24     for (i = 0; mp->msgattrs[i]; i++) {
25         len = strlen (buffer);
26         snprintf (buffer + len, sizeof(buffer) - len,
27                 "%c%s", FFATTRSLOT + 1 + i, mp->msgattrs[i]);
28     }
29
30     return buffer;
31 }