problem with strcat function

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ramubdvt@gmail.com

    #1

    problem with strcat function

    hi,
    i have written this strcat but sometime it is giving problem, while
    handeling some strings containing
    binary and if string containing zero ,
    funtion which takes string 1 and its length string2 and its length as
    arguments

    please tell the correction ,

    here iam using
    typedef char SINT8;
    typedef unsigned char UINT8;
    typedef short SINT16;
    typedef unsigned short UINT16;
    typedef int SINT32;
    typedef unsigned int UINT32;
    typedef long long UINT64;

    UINT8 *
    Stringcat (UINT8 *str1
    , UINT32 str1len
    , UINT8 *str2
    , UINT32 str2len )
    {
    UINT8 *str3, *temp;
    temp = str3 = (char *) calloc (( str1len + str2len) + 1) ,1 );
    while ( ( *str3++ = *str1++) );
    str3--;
    while ( ( *str3++ = *str2++ ) );
    return temp;
    }


    regards
    ramaswamy BM
    banglore

Working...