Log in

No account? Create an account
entries friends calendar profile My Website Previous Previous Next Next
Mark Atwood
Spot the stupid bug
 { struct foo a; magicfunc((void *) &a, sizeof(a)); fprintf(stdlog, "value1 %d\n", a.x); }

{ uint8_t *b; b = (uint8_t *) malloc(N); magicfunc((void *) &b, N); fprintf(stdlog, "value2 %d\n", *(b+0)); } 

I've been beating myself over the head on this since yesterday afternoon, `till I *finally* saw that extra ampersand.

Mark feel dumb.
1 comment or Leave a comment
simonb From: simonb Date: May 27th, 2004 08:47 am (UTC) (Link)
Took me a couple of looks to see the extra & as well; sometimes pointers in C are evil.
1 comment or Leave a comment