![]() |
Re: C run time error in Tandem.
On 1/4/2013 12:33 AM, jk__c wrote:
> 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. How do you know that the error occurs in the sprintf? What happens if you remove the sprintf call entirely? > ERROR > ----------------------------------- > - *** Run-time Error 003 *** > - Instruction failure > > CODE SNIPPET > ------------------------------------ > > unsigned char sha256sum[32]; > char converted[65]; > .... > .... > > for( j = 0; j < 32; j++ ) > { > sprintf(&converted[j*2],"%02X",sha256sum[j]); > } There's nothing wrong in the code you've posted, but it's quite possible that something elsewhere is the actual cause of the problem. |
| All times are GMT. The time now is 01:24 PM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.