home *** CD-ROM | disk | FTP | other *** search
/ linuxmafia.com 2016 / linuxmafia.com.tar / linuxmafia.com / pub / palmos / pippy-0.6beta-src.tar.gz / pippy-0.6beta-src.tar / pippy-0.6beta-src / src / Palm / libc / strncat.c < prev    next >
C/C++ Source or Header  |  2000-12-21  |  401b  |  28 lines

  1. /*
  2.  *  linux/lib/string.c
  3.  *
  4.  *  Copyright (C) 1991, 1992  Linus Torvalds
  5.  */
  6.  
  7. #include <sys/types.h>
  8. #include <string.h>
  9. #include <ctype.h>
  10.  
  11. #ifndef __HAVE_ARCH_STRNCAT
  12. char * strncat(char *dest, const char *src, size_t count)
  13. {
  14.   char *tmp = dest;
  15.   
  16.   if (count) {
  17.     while (*dest)
  18.       dest++;
  19.     while ((*dest++ = *src++)) {
  20.       if (--count == 0)
  21.     break;
  22.     }
  23.   }
  24.   
  25.   return tmp;
  26. }
  27. #endif
  28.