]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/progs/ptt.c
Replaced use of snprintf() with memcpy()/memmove().
[nmh] / docs / historical / mh-jun-1982 / progs / ptt.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 "../adrparse.h"
9
10 main(argc, argv)
11 int argc;
12 char *argv[];
13 {
14 register struct mailname *mp;
15 register char *cp;
16
17 if(!(mp = getm(argv[1],"RAND-UNIX"))) {
18 printf("adrparse returned 0\n");
19 exit(0);
20 }
21 printf("%s\n", mp->m_text);
22 printf("mbox: %s\n", mp->m_mbox);
23 if(!mp->m_nohost) {
24 printf("at: ");
25 cp = mp->m_at;
26 if(*cp == '@') putchar('@');
27 else while(*cp != ' ') putchar(*cp++);
28 printf("\n");
29 }
30 printf("host: %s ", mp->m_host);
31 if(mp->m_nohost)
32 printf("[default] ");
33 else {
34 putchar('"');
35 for(cp = mp->m_hs; cp <= mp->m_he; )
36 putchar(*cp++);
37 putchar('"');
38 }
39 printf("\n");
40 printf("hnum: %d\n", mp->m_hnum);
41 printf("Proper: %s\n", adrformat(mp,"RAND-UNIX"));
42 }