Minor tweaks to avoid using unitialized memory.
This commit is contained in:
parent
3eb6f1d640
commit
2912a48965
2 changed files with 16 additions and 6 deletions
|
@ -82,7 +82,8 @@ double fgCalcEccAnom(double M, double e)
|
||||||
|
|
||||||
int fgReadOrbElements(struct OrbElements *dest, gzFile src) {
|
int fgReadOrbElements(struct OrbElements *dest, gzFile src) {
|
||||||
char line[256];
|
char line[256];
|
||||||
int i,j;
|
int i, j, len;
|
||||||
|
|
||||||
j = 0;
|
j = 0;
|
||||||
do {
|
do {
|
||||||
if ( fggets(src, line, 256) == NULL ) {
|
if ( fggets(src, line, 256) == NULL ) {
|
||||||
|
@ -90,7 +91,9 @@ int fgReadOrbElements(struct OrbElements *dest, gzFile src) {
|
||||||
"End of file found while reading planetary positions:\n");
|
"End of file found while reading planetary positions:\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
for (i = 0; i < 256; i++) {
|
len = strlen(line);
|
||||||
|
|
||||||
|
for (i = 0; i < len; i++) {
|
||||||
if (line[i] == '#')
|
if (line[i] == '#')
|
||||||
line[i] = 0;
|
line[i] = 0;
|
||||||
}
|
}
|
||||||
|
@ -167,9 +170,12 @@ void fgSolarSystemUpdate(struct OrbElements *planet, fgTIME t)
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.7 1998/07/13 21:00:09 curt
|
/* Revision 1.8 1998/08/22 01:18:59 curt
|
||||||
/* Wrote access functions for current fgOPTIONS.
|
/* Minor tweaks to avoid using unitialized memory.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.7 1998/07/13 21:00:09 curt
|
||||||
|
* Wrote access functions for current fgOPTIONS.
|
||||||
|
*
|
||||||
* Revision 1.6 1998/05/29 20:35:41 curt
|
* Revision 1.6 1998/05/29 20:35:41 curt
|
||||||
* Added zlib support for reading in compressed data files.
|
* Added zlib support for reading in compressed data files.
|
||||||
*
|
*
|
||||||
|
|
|
@ -286,6 +286,7 @@ void fgSkyRender( void ) {
|
||||||
middle_color[i] = l->sky_color[i] - diff * 0.9;
|
middle_color[i] = l->sky_color[i] - diff * 0.9;
|
||||||
outer_color[i] = l->adj_fog_color[i];
|
outer_color[i] = l->adj_fog_color[i];
|
||||||
}
|
}
|
||||||
|
inner_color[3] = middle_color[3] = outer_color[3] = l->adj_fog_color[3];
|
||||||
|
|
||||||
xglPushMatrix();
|
xglPushMatrix();
|
||||||
|
|
||||||
|
@ -367,9 +368,12 @@ void fgSkyRender( void ) {
|
||||||
|
|
||||||
|
|
||||||
/* $Log$
|
/* $Log$
|
||||||
/* Revision 1.8 1998/08/12 21:40:44 curt
|
/* Revision 1.9 1998/08/22 01:18:59 curt
|
||||||
/* Sky now tracks adjusted fog color so it blends well with terrain.
|
/* Minor tweaks to avoid using unitialized memory.
|
||||||
/*
|
/*
|
||||||
|
* Revision 1.8 1998/08/12 21:40:44 curt
|
||||||
|
* Sky now tracks adjusted fog color so it blends well with terrain.
|
||||||
|
*
|
||||||
* Revision 1.7 1998/07/22 21:39:21 curt
|
* Revision 1.7 1998/07/22 21:39:21 curt
|
||||||
* Lower skirt tracks adjusted fog color, not fog color.
|
* Lower skirt tracks adjusted fog color, not fog color.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue