problem with strcat function

Discussion in 'C Programming' started by ramubdvt@gmail.com, Mar 23, 2006.

  1. Guest

    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
     
    , Mar 23, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ian Stanley

    strcat problem

    Ian Stanley, Sep 12, 2003, in forum: C Programming
    Replies:
    5
    Views:
    3,623
    Irrwahn Grausewitz
    Sep 13, 2003
  2. Ian Stanley

    strcat problem again

    Ian Stanley, Sep 17, 2003, in forum: C Programming
    Replies:
    18
    Views:
    703
    Martijn Lievaart
    Sep 22, 2003
  3. JC

    strcpy and strcat problem

    JC, Sep 26, 2003, in forum: C Programming
    Replies:
    23
    Views:
    1,930
    Robert B. Clark
    Sep 29, 2003
  4. Replies:
    24
    Views:
    1,218
    Greg Comeau
    Oct 30, 2005
  5. problem with strcat function

    , Mar 23, 2006, in forum: C Programming
    Replies:
    20
    Views:
    882
    Jordan Abel
    Mar 25, 2006
Loading...

Share This Page