FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Dobbs M-Dev
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
February 01, 2003

Avoiding the Visual C++ Runtime Library

(Page 14 of 16)
February 2003/Avoiding the Visual C++ Runtime Library

Listing 7 Extract from strncat.c


/* /////////////////////////////////////////////////////////////
 * ...
 *
 * Extract from strncat.c
 *
 * Copyright (C) 2002, Synesis Software Pty Ltd.
 * (Licensed under the Synesis Software Standard Source License:
 *  http://www.synesis.com.au/licenses/ssssl.html)
 *
 * ...
 * ////////////////////////////////////////////////////////// */

char * __cdecl strncat(char *dest, const char *src, size_t count)
{
    char *dst;

    for(dst = dest; *dst; ++dst);

    for(; count && (*dst = *src) != '\0'; ++dst, ++src, --count)
    {}

    if(count)
    {
        *dst = '\0';
    }

    return dest;
}

Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 Next Page
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK