home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0020 - 0029 / ibm0020-0029 / ibm0028.tar / ibm0028 / GRLF-C-2.ZIP / GFUNC / STRMAKE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-05-30  |  902 b   |  54 lines

  1. /*
  2.  * strmake.c
  3.  * contains: 
  4.  *
  5.  */
  6.  
  7. #include <stdio.h>
  8. #include <string.h>
  9. #include "gfuncts.h"
  10.  
  11. /*
  12.  *  char *
  13.  * strmake( dst, s1,...)
  14.  *
  15.  * ARGUMENT
  16.  *  char *dst;        Destination string area
  17.  *  char *s1,..;    Source strings (NULL terminated)
  18.  *
  19.  * DESCRIPTION
  20.  *  Concatenates all non-NULL strings s1-... into dst.
  21.  *
  22.  * SIDE EFFECTS
  23.  *  No idea if overwrites destination area.
  24.  *
  25.  * RETURNS
  26.  *  Pointer to destination string.  NULL if dst or s1 is NULL.
  27.  *
  28.  * AUTHOR
  29.  *   DK  02-Mar-1989  15:47:04
  30.  *   Copyright (C)1989-1990 Greenleaf Software Inc. All Rights Reserved.
  31.  *
  32.  * MODIFICATIONS
  33.  *
  34.  */
  35. #ifndef _MSC
  36. char* GF_CDECL strmake(dst,s1)
  37. #else
  38. char* GF_CDECL strmake(dst,s1,...)
  39. #endif
  40. char *dst,*s1;
  41. {
  42.     char **value;
  43.  
  44.     if(!dst||!s1)
  45.         return(NULL);
  46.     value=&s1;
  47.     *dst='\0';
  48.     while(*value) {
  49.         strcat(dst,*value);
  50.         ++value;
  51.     }
  52.     return(dst);
  53. }
  54.