Dima Pasechnik wrote: > > > On Wednesday, June 8, 2016 at 3:28:26 PM UTC+1, Jeroen Demeyer wrote: > > On 2016-06-08 15:07, William Stein wrote: > > Thanks. Here is the *actual* code from sympow: > > > > fclose(F); printf("Left with %i entries in param_data\n",i); > > F=fopen("datafiles/param_data","w"); > > ... > > The interesting stuff is what is below the fopen() call, i.e. the stuff > hidden by the "..." > > F=fopen("datafiles/param_data","w"); > for (j=0;j<i;j++) fprintf(F,"%s",PARAM[j]); fclose(F);} > > there is also > > void txt2bin(int num,char *B,FILE *R) > {double *P; FILE *F; P=malloc(36*4*num*sizeof(double)); > read_file_mesh(num,P,R); F=fopen(B,"w"); > fwrite(P,sizeof(double),36*4*num,F); fclose(F); free(P);}
... where the return value of malloc() isn't checked either. -leif -- You received this message because you are subscribed to the Google Groups "sage-devel" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+unsubscr...@googlegroups.com. To post to this group, send email to sage-devel@googlegroups.com. Visit this group at https://groups.google.com/group/sage-devel. For more options, visit https://groups.google.com/d/optout.