init of a and b values
[physik/posic.git] / random / random.c
index df77980..292bc69 100644 (file)
@@ -36,6 +36,7 @@ int rand_init(t_random *random,char *randomfile,int logfd) {
                        return -1;
                }
        }
+       random->buffer=NULL;
        random->buffer=malloc(RAND_BUFSIZE*sizeof(unsigned int));
        if(random->buffer==NULL) {
                perror("malloc random buffer");
@@ -108,6 +109,7 @@ double rand_get_gauss(t_random *random) {
                return random->gauss;
        }
 
+       a=0; b=0;
        w=0;
        while((w>=1.0)||(w==0.0)) {
                a=-2.0*rand_get_double(random)+1.0;