diff options
| author | Keith Packard <keithp@keithp.com> | 2009-11-21 20:36:20 -0800 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2009-11-21 20:37:53 -0800 | 
| commit | 199f0cecae22645140185238682b9e1aba0e5715 (patch) | |
| tree | 00f9587b1099a29ec6ed42f841c5a51dea021512 | |
| parent | 238d03462a56dc1b7c871608cb00f961a88c1b97 (diff) | |
Make TD print 0000-00-00 for invalid dates.
This 'shouldn't' happen, but in case it does, I want to know about it.
Signed-off-by: Keith Packard <keithp@keithp.com>
| -rw-r--r-- | src/ao_gps_print.c | 11 | 
1 files changed, 7 insertions, 4 deletions
diff --git a/src/ao_gps_print.c b/src/ao_gps_print.c index b8b73cd2..11213174 100644 --- a/src/ao_gps_print.c +++ b/src/ao_gps_print.c @@ -53,10 +53,13 @@ ao_gps_print(__xdata struct ao_gps_data *gps_data) __reentrant  		ao_gps_split(gps_data->latitude, &lat);  		ao_gps_split(gps_data->longitude, &lon); -		printf(" 20%02d-%02d-%02d", -		       gps_data->year, -		       gps_data->month, -		       gps_data->day); +		if (gps_data->flags & AO_GPS_DATE_VALID) +			printf(" 20%02d-%02d-%02d", +			       gps_data->year, +			       gps_data->month, +			       gps_data->day); +		else +			printf (" 0000-00-00");  		printf(" %2d:%02d:%02d",  		       gps_data->hour,  		       gps_data->minute,  | 
