]> diplodocus.org Git - nmh/blob - sbr/m_name.c
Fix a segfault that happens when using the -file option.
[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 <h/mh.h>
11
12 static char name[BUFSIZ];
13
14
15 char *
16 m_name (int num)
17 {
18 if (num <= 0)
19 return "?";
20
21 snprintf (name, sizeof(name), "%d", num);
22 return name;
23 }