]> diplodocus.org Git - nmh/blob - sbr/m_name.c
Alter mh-chart(7)'s NAME to be lowercase.
[nmh] / sbr / m_name.c
1
2 /*
3 * m_name.c -- return a message number as a string
4 *
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.
8 */
9
10 #include <limits.h>
11 #include <h/mh.h>
12
13 #define STR(s) #s
14 #define SIZE(n) (sizeof STR(n)) /* Includes NUL. */
15
16 char *
17 m_name (int num)
18 {
19 static char name[SIZE(INT_MAX)];
20
21 if (num <= 0)
22 return "?";
23
24 snprintf(name, sizeof name, "%d", num);
25
26 return name;
27 }