Re: C run time error in Tandem.

Discussion in 'C Programming' started by BartC, Jan 4, 2013.

  1. BartC

    BartC Guest

    "jk__c" <> wrote in message
    news:...
    > I get a run time error in the below sprintf when I try executing the c
    > program in Tandem. This code is successfully compiled and tested in
    > windows. I'm trying to convert an array of unsigned char to a char string
    > using sprintf and it fails exactly at this line. If I replace sprintf with
    > a normal printf("%02X",sha256sum[j])
    > in the below code also the same error occurs.


    > unsigned char sha256sum[32];
    > char converted[65];
    > ....
    > ....
    >
    > for( j = 0; j < 32; j++ )
    > {
    > sprintf(&converted[j*2],"%02X",sha256sum[j]);
    > }


    What's the value of j when it fails? What happens when you vary a few
    things?

    (Eg, working with printf(), print less than 32 values, or print the same
    element of sha256sum 32 times, or print another signed char array instead,
    or use a different print format such as "%d", etc. At some point, the error
    will disappear, and that might give a clue. Although it's also possible the
    error is something else entirely and only manifests itself here.)

    --
    bartc
    BartC, Jan 4, 2013
    #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. Ajay

    Use of AXIS on Tandem

    Ajay, Oct 16, 2003, in forum: Java
    Replies:
    0
    Views:
    411
  2. Johann Klammer

    Re: C run time error in Tandem.

    Johann Klammer, Jan 4, 2013, in forum: C Programming
    Replies:
    0
    Views:
    183
    Johann Klammer
    Jan 4, 2013
  3. Joachim Schmitz

    Re: C run time error in Tandem.

    Joachim Schmitz, Jan 4, 2013, in forum: C Programming
    Replies:
    0
    Views:
    244
    Joachim Schmitz
    Jan 4, 2013
  4. Ken Brody

    Re: C run time error in Tandem.

    Ken Brody, Jan 4, 2013, in forum: C Programming
    Replies:
    0
    Views:
    180
    Ken Brody
    Jan 4, 2013
  5. Tor Rustad

    Re: C run time error in Tandem.

    Tor Rustad, Jan 10, 2013, in forum: C Programming
    Replies:
    0
    Views:
    199
    Tor Rustad
    Jan 10, 2013
Loading...

Share This Page