Post by Miha NedokYes that's the debugger. The idea was to print the converted unsigned
char to char.
My problem is: Calling a function that expects a unsigned char and my
data get's "garbled" because the output isn't OK. Actually I'm calling
openssl's functions for encrypying. I get no error from them. But when
decrypting the data it's no really OK... some chars are added on the
beggining and on the end.
Briefly show how you're doing your output. All I can think of is that you're
using something like printf("%x"), and if your output is the "0xfffffff8"
you mentioned last time, you might be passing a char variable equal to 0xF8
(i.e. -8) to printf, which is subject to the integral promotion rule I
mentioned last time. In other words, your char contains -8, and when
promoted to int, the int result contains -8, which has the representation
0xFFFFFFF8 in two's complement. To fix that, you would say:
// x is a char
printf("%x\n", (unsigned char) x);
Above, x is interpreted as unsigned char for the integral promotion, and the
result of the promotion is 0xF8 (but contained in an int), which is OK to
pass to "%x".
--
Doug Harrison
Microsoft MVP - Visual C++