diff options
Diffstat (limited to 'indra/llmath')
-rw-r--r-- | indra/llmath/llmath.h | 3 | ||||
-rw-r--r-- | indra/llmath/llvolume.cpp | 18 |
2 files changed, 18 insertions, 3 deletions
diff --git a/indra/llmath/llmath.h b/indra/llmath/llmath.h index 5fd365086f..5fa74f30f2 100644 --- a/indra/llmath/llmath.h +++ b/indra/llmath/llmath.h @@ -22,6 +22,9 @@ #elif (LL_LINUX && __GNUC__ <= 2) #define llisnan(val) isnan(val) #define llfinite(val) isfinite(val) +#elif LL_SOLARIS +#define llisnan(val) isnan(val) +#define llfinite(val) (val <= std::numeric_limits<double>::max()) #else #define llisnan(val) std::isnan(val) #define llfinite(val) std::isfinite(val) diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp index 67ffb6d628..7345dabf72 100644 --- a/indra/llmath/llvolume.cpp +++ b/indra/llmath/llvolume.cpp @@ -730,7 +730,11 @@ BOOL LLProfileParams::importFile(FILE *fp) while (!feof(fp)) { - fgets(buffer, BUFSIZE, fp); + if (fgets(buffer, BUFSIZE, fp) == NULL) + { + buffer[0] = '\0'; + } + sscanf( /* Flawfinder: ignore */ buffer, " %255s %255s", @@ -1231,7 +1235,11 @@ BOOL LLPathParams::importFile(FILE *fp) while (!feof(fp)) { - fgets(buffer, BUFSIZE, fp); + if (fgets(buffer, BUFSIZE, fp) == NULL) + { + buffer[0] = '\0'; + } + sscanf( /* Flawfinder: ignore */ buffer, " %255s %255s", @@ -3562,7 +3570,11 @@ BOOL LLVolumeParams::importFile(FILE *fp) while (!feof(fp)) { - fgets(buffer, BUFSIZE, fp); + if (fgets(buffer, BUFSIZE, fp) == NULL) + { + buffer[0] = '\0'; + } + sscanf(buffer, " %255s", keyword); /* Flawfinder: ignore */ if (!strcmp("{", keyword)) { |