- p3dfft.2.3.2/sample/C/*.c about line 61
There is no check wether file stdin exists. This leads to hard to find
segmentations faults, if the user didn't copy stdin from the sample folder
into the C folder.
A warning for the user would be nice. So I replaced
> fp = fopen("stdin","r");
> ndim = 2;
> fscanf(fp,"%d,%d,%d,%d,%d\n",&nx,&ny,&nz,&ndim,&n);
> fclose(fp);
by
> ndim = 2;
> if((fp=fopen("stdin", "r"))==NULL){
> printf("Cannot open file. Setting to default nx=ny=nz=128, ndim=2, n=1.
\n");
> nx=ny=nz=128; n=1;
> }
> else{
> fscanf(fp,"%d,%d,%d,%d,%d\n",&nx,&ny,&nz,&ndim,&n);
> fclose(fp);
> }
Original issue reported on code.google.com by d4p...@ucsd.edu on 3 Mar 2010 at 1:23
Original issue reported on code.google.com by
d4p...@ucsd.edu
on 3 Mar 2010 at 1:23