File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
mcstas-comps/examples/Tests_optics/Test_Monochromator_bent_complex Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -163,19 +163,24 @@ double y_rots[92] = {
163163if (use_single_plane){
164164
165165 input_planes = malloc(5*sizeof(char));
166+ if (!input_planes){
167+ printf("\nError Mallocing input planes! Exiting \n");
168+ exit(1);
169+ }
166170 input_planes = "Si111";
167171} else {
168- printf("Running input planes\n");
169172 input_planes = malloc(92*5*sizeof(char) + 92*sizeof(char));
170- printf("Malloc worked!\n");
173+ if (!input_planes){
174+ printf("\nError Mallocing input planes! Exiting \n");
175+ exit(1);
176+ }
171177 strcpy(input_planes, "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;"
172178 "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;"
173179 "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;"
174180 "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;"
175181 "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;"
176182 "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;"
177183 "Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111;Si111");
178- printf("\nAfter input planes\n");
179184}
180185
181186
You can’t perform that action at this time.
0 commit comments