home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / linux / backup / star-1.3.1.tar.gz / star-1.3.1.tar / star-1.3.1 / lib / strcatl.c < prev    next >
C/C++ Source or Header  |  2000-05-07  |  1KB  |  58 lines

  1. /* @(#)strcatl.c    1.10 00/05/07 Copyright 1985 J. Schilling */
  2. /*
  3.  *    list version of strcat()
  4.  *
  5.  *    concatenates all past first parameter until a NULL pointer is reached
  6.  *    returns pointer past last character (to '\0' byte)
  7.  *
  8.  *    Copyright (c) 1985 J. Schilling
  9.  */
  10. /*
  11.  * This program is free software; you can redistribute it and/or modify
  12.  * it under the terms of the GNU General Public License as published by
  13.  * the Free Software Foundation; either version 2, or (at your option)
  14.  * any later version.
  15.  *
  16.  * This program is distributed in the hope that it will be useful,
  17.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19.  * GNU General Public License for more details.
  20.  *
  21.  * You should have received a copy of the GNU General Public License
  22.  * along with this program; see the file COPYING.  If not, write to
  23.  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  24.  */
  25.  
  26. #include <mconfig.h>
  27. #include <vadefs.h>
  28. #include <standard.h>
  29. #include <schily.h>
  30.  
  31. /* VARARGS3 */
  32. #ifdef    PROTOTYPES
  33. char *strcatl(char *to, ...)
  34. #else
  35. char *strcatl(to, va_alist)
  36.     char *to;
  37.     va_dcl
  38. #endif
  39. {
  40.         va_list    args;
  41.     register char    *p;
  42.     register char    *tor = to;
  43.  
  44. #ifdef    PROTOTYPES
  45.     va_start(args, to);
  46. #else
  47.     va_start(args);
  48. #endif
  49.     while ((p = va_arg(args, char *)) != NULL) {
  50.         while ((*tor = *p++) != '\0') {
  51.             tor++;
  52.         }
  53.     }
  54.     *tor = '\0';
  55.     va_end(args);
  56.     return (tor);
  57. }
  58.