]> diplodocus.org Git - nmh/blob - sbr/m_name.c
Makefile.am: Add test/inc/test-eom-align to XFAIL_TESTS.
[nmh] / sbr / m_name.c
1 /* m_name.c -- return a message number as a string
2 *
3 * This code is Copyright (c) 2002, by the authors of nmh. See the
4 * COPYRIGHT file in the root directory of the nmh distribution for
5 * complete copyright information.
6 */
7
8 #include <limits.h>
9 #include <h/mh.h>
10
11 #define STR(s) #s
12 #define SIZE(n) (sizeof STR(n)) /* Includes NUL. */
13
14 char *
15 m_name (int num)
16 {
17 static char name[SIZE(INT_MAX)];
18
19 if (num <= 0)
20 return "?";
21
22 snprintf(name, sizeof name, "%d", num);
23
24 return name;
25 }