0

enter image description here

As you can see, the value of buffer[0] changes when the line sprintf(tittle, %03d.jpg", images);, which has nothing to do with the buffer. All of the values in buffer are changed. I went through my code a thousand times, and I finally found out this. It's really frustrating! Any explanations?

1

I reserved only 4 bytes for the title while I needed 8. The buffer was overwritten as a result of this.

| improve this answer | |
  • Can you please send me your code before you fixed this bug? – Kareem Jul 1 '14 at 11:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .