Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

E-R-R-O-R

Name: Anonymous 2010-10-04 23:14

http://pastebin.com/xJxufXZ4 <-- It seems to be breaking @ free(Counter) towards the bottom

error message:
http://yfrog.com/08fffffffffffffffffffffp

Am i doin' something wrong with my Counter array?

Name: Anonymous 2010-10-05 0:48

>>1
I don't want to read your code.  Nobody wants to read that.  Get valgrind and use its memcheck tool (you know, the default one) because your code has memory errors.

Name: Anonymous 2010-10-05 0:50

This is not good code. Rewrite it so it is. (Perhaps you'll accidentally fix the bug when you rewrite it).

Name: Anonymous 2010-10-05 2:03

I'm in good mood today.

Counter[ix*2+2][iy*2+1] = (Counter[ix*2+2][iy*2] + Counter[ix*2+2][iy*2+2]) / 2 + ((rand()%255-128)*RND_Factor_2);

the problem is here.

iy*2+2 will be >2 when iy = 1

now GTFO.

Name: Anonymous 2010-10-05 2:12

You casted the result of malloc. You didn't check the result of malloc. You didn't call free on each Counter[i].

Name: Anonymous 2010-10-05 6:22

>>5
Checking the result of malloc is pointless in pretty much all cases.

Name: Anonymous 2010-10-05 6:26

Your function has over100 LOC.
shame on you, ``faggot''.

Name: Anonymous 2010-10-05 15:29

>>6
If you don't want to check the result, then call xmalloc instead.


#include <stdlib.h>
#include <stdio.h>
void *xmalloc(size_t s) {
    void *p = malloc(s);
    if (!p) { fputs("out of memory\n", stderr); exit(1); }
    return p;
}

Don't change these.
Name: Email:
Entire Thread Thread List