Keith Hughitt | 11 May 2012 16:13
Picon
Gravatar

Re: Converting python byte-string to unsigned char* array?

Hi Stefan,

I just finished writing up a lengthy response with the exact errors I was encountering when I discovered that the casting *is* working: It turns out that I had forgotten to remove an earlier call to "free()" from when I was reading in the data using C. At some point I was also getting a different error (the result to a call to a third-party library was NULL indicating a problem with my input) which is why I thought the problem may be with the type-casting. I'm not sure what change I made to fix that.

Your feedback was still very helpful, however, and I think I'm slowly becoming reacquainted with C coding and some of the caveats and pitfalls I haven't had to deal with after so many years of working in higher-level lang uages.

Thanks,
Keith

Gmane