]> diplodocus.org Git - nmh/blob - sbr/m_name.c
sendsbr.c: Move interface to own file.
[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 #include "m_name.h"
11 #include "h/utils.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 if (num <= 0) return "?";
20
21 return m_strn(num, SIZE(INT_MAX));
22 }