Skip to content

Commit 656b141

Browse files
committed
Uninitialized variables found by static analysis.
1 parent 590c82b commit 656b141

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

geotranz/mgrs.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,7 @@ long Convert_MGRS_To_Geodetic (char* MGRS,
868868
*/
869869
{ /* Convert_MGRS_To_Geodetic */
870870
long zone;
871-
char hemisphere;
871+
char hemisphere = '?';
872872
double easting;
873873
double northing;
874874
long zone_exists;
@@ -1260,9 +1260,9 @@ long Convert_MGRS_To_UPS ( char *MGRS,
12601260
double false_northing; /* False northing for 3rd letter */
12611261
double grid_easting; /* easting for 100,000 meter grid square */
12621262
double grid_northing; /* northing for 100,000 meter grid square */
1263-
long zone;
1263+
long zone = 0;
12641264
long letters[MGRS_LETTERS];
1265-
long in_precision;
1265+
long in_precision = 0;
12661266
int index = 0;
12671267
long error_code = MGRS_NO_ERROR;
12681268

geotranz/usng.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -782,7 +782,7 @@ long Convert_USNG_To_Geodetic (char* USNG,
782782
*/
783783
{ /* Convert_USNG_To_Geodetic */
784784
long zone;
785-
char hemisphere;
785+
char hemisphere = '?';
786786
double easting;
787787
double northing;
788788
long zone_exists;
@@ -1178,9 +1178,9 @@ long Convert_USNG_To_UPS ( char *USNG,
11781178
double false_northing; /* False northing for 3rd letter */
11791179
double grid_easting; /* easting for 100,000 meter grid square */
11801180
double grid_northing; /* northing for 100,000 meter grid square */
1181-
long zone;
1181+
long zone = 0;
11821182
long letters[USNG_LETTERS];
1183-
long in_precision;
1183+
long in_precision = 0;
11841184
int index = 0;
11851185
long error_code = USNG_NO_ERROR;
11861186

0 commit comments

Comments
 (0)