]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/m_name.c
Replaced use of snprintf() with memcpy()/memmove().
[nmh] / docs / historical / mh-jun-1982 / subs / m_name.c
1 #ifdef COMMENT
2 Proprietary Rand Corporation, 1981.
3 Further distribution of this software
4 subject to the terms of the Rand
5 license agreement.
6 #endif
7
8 #include "../mh.h"
9
10 char *m_name(num)
11 {
12 static char name[4];
13 register char *cp;
14 register int i;
15
16 name[0] = 0;
17 name[1] = 0;
18 name[2] = 0;
19 name[3] = 0;
20 i = num;
21 cp = &name[3];
22 if(i > 0 && i <= MAXFOLDER)
23 do {
24 *--cp = (i % 10) + '0';
25 i /= 10;
26 } while(i);
27 else
28 *--cp = '?';
29 return(cp);
30 }