| 93 |
|
if (wdb == NULL) /* no geometry section? */ |
| 94 |
|
return SDEnone; |
| 95 |
|
sd->dim[0] = sd->dim[1] = sd->dim[2] = .0; |
| 96 |
+ |
SDerrorDetail[0] = '\0'; |
| 97 |
|
if ((geom = ezxml_child(wdb, "Width")) != NULL) |
| 98 |
|
sd->dim[0] = atof(ezxml_txt(geom)) * |
| 99 |
|
to_meters(ezxml_attr(geom, "unit")); |
| 104 |
|
sd->dim[2] = atof(ezxml_txt(geom)) * |
| 105 |
|
to_meters(ezxml_attr(geom, "unit")); |
| 106 |
|
if ((sd->dim[0] < 0) | (sd->dim[1] < 0) | (sd->dim[2] < 0)) { |
| 107 |
< |
sprintf(SDerrorDetail, "Negative size in \"%s\"", sd->name); |
| 107 |
> |
if (!SDerrorDetail[0]) |
| 108 |
> |
sprintf(SDerrorDetail, "Negative dimension in \"%s\"", |
| 109 |
> |
sd->name); |
| 110 |
|
return SDEdata; |
| 111 |
|
} |
| 112 |
|
if ((geom = ezxml_child(wdb, "Geometry")) == NULL || |
| 124 |
|
return SDEsupport; |
| 125 |
|
} |
| 126 |
|
cfact = to_meters(ezxml_attr(geom, "unit")); |
| 127 |
+ |
if (cfact <= 0) |
| 128 |
+ |
return SDEformat; |
| 129 |
|
sd->mgf = (char *)malloc(strlen(mgfstr)+32); |
| 130 |
|
if (sd->mgf == NULL) { |
| 131 |
|
strcpy(SDerrorDetail, "Out of memory in SDloadGeometry"); |
| 169 |
|
} |
| 170 |
|
wtl = ezxml_child(ezxml_child(fl, "Optical"), "Layer"); |
| 171 |
|
if (wtl == NULL) { |
| 172 |
< |
sprintf(SDerrorDetail, "BSDF \"%s\": no optical layer'", |
| 172 |
> |
sprintf(SDerrorDetail, "BSDF \"%s\": no optical layers'", |
| 173 |
|
sd->name); |
| 174 |
|
ezxml_free(fl); |
| 175 |
|
return SDEformat; |