]> diplodocus.org Git - nmh/blob - docs/historical/mh-jun-1982/subs/add.c
Create new mh-format function %(ordinal)
[nmh] / docs / historical / mh-jun-1982 / subs / add.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 <stdio.h>
9 #include "../mh.h"
10
11 char *sprintf();
12 char *malloc();
13
14 char *add(this, that)
15 register char *this, *that;
16 {
17 register char *r;
18
19 if(!this)
20 this = "";
21 if(!that)
22 that = "";
23 r = malloc((unsigned) (strlen(this)+strlen(that)+1));
24 VOID sprintf(r, "%s%s", that, this);
25 if(*that)
26 cndfree(that);
27 return(r);
28 }