From 89021dd50c83a3b12b2d18b8ff8c502c3080232f Mon Sep 17 00:00:00 2001 From: wb2osz Date: Wed, 16 Feb 2022 02:42:15 +0000 Subject: [PATCH] Cleanups --- src/config.c | 38 +++++++++++++++++++++++------ src/config.h | 10 ++++---- src/digipeater.h | 6 +++++ src/direwolf.c | 2 +- src/dlq.c | 63 +++++++++++++++++++++++++++++++++++++++++++++++- src/kissnet.c | 5 ++++ src/log2gpx.c | 6 ++--- src/mheard.c | 10 ++++++++ src/rrbb.c | 6 ++++- src/symbols.c | 35 +++++++++++++++++++-------- src/tnctest.c | 10 ++++---- src/tt_text.c | 12 +++++---- src/ttcalc.c | 2 +- src/waypoint.c | 16 ++++++------ 14 files changed, 173 insertions(+), 48 deletions(-) diff --git a/src/config.c b/src/config.c index 85a2028..4d1f0dd 100644 --- a/src/config.c +++ b/src/config.c @@ -4896,19 +4896,19 @@ void config_init (char *fname, struct audio_s *p_audio_config, for ( ; *t != '\0' ; t++ ) { switch (toupper(*t)) { case 'N': - p_misc_config->waypoint_formats |= WPT_FORMAT_NMEA_GENERIC; + p_misc_config->waypoint_formats |= WPL_FORMAT_NMEA_GENERIC; break; case 'G': - p_misc_config->waypoint_formats |= WPT_FORMAT_GARMIN; + p_misc_config->waypoint_formats |= WPL_FORMAT_GARMIN; break; case 'M': - p_misc_config->waypoint_formats |= WPT_FORMAT_MAGELLAN; + p_misc_config->waypoint_formats |= WPL_FORMAT_MAGELLAN; break; case 'K': - p_misc_config->waypoint_formats |= WPT_FORMAT_KENWOOD; + p_misc_config->waypoint_formats |= WPL_FORMAT_KENWOOD; break; case 'A': - p_misc_config->waypoint_formats |= WPT_FORMAT_AIS; + p_misc_config->waypoint_formats |= WPL_FORMAT_AIS; break; case ' ': case ',': @@ -5470,6 +5470,10 @@ void config_init (char *fname, struct audio_s *p_audio_config, * Returns 1 for success, 0 for serious error. */ +// FIXME: provide error messages when non applicable option is used for particular beacon type. +// e.g. IBEACON DELAY=1 EVERY=1 SENDTO=IG OVERLAY=R SYMBOL="igate" LAT=37^44.46N LONG=122^27.19W COMMENT="N1KOL-1 IGATE" +// Just ignores overlay, symbol, lat, long, and comment. + static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_s *p_audio_config) { char *t; @@ -5643,8 +5647,28 @@ static int beacon_options(char *cmd, struct beacon_s *b, int line, struct audio_ } else if (strcasecmp(keyword, "ALT") == 0 || strcasecmp(keyword, "ALTITUDE") == 0) { -// TODO: allow units. - b->alt_m = atof(value); + char *unit = strpbrk(value, "abcedfghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"); + if (unit != NULL) { + float meters = 0; + for (int j=0; jalt_m = atof(value); + } + else { + // valid unit + b->alt_m = atof(value) * meters; + } + } else { + // no unit specified + b->alt_m = atof(value); + } } else if (strcasecmp(keyword, "ZONE") == 0) { strlcpy(zone, value, sizeof(zone)); diff --git a/src/config.h b/src/config.h index bfc4e12..5ab2ae9 100644 --- a/src/config.h +++ b/src/config.h @@ -98,11 +98,11 @@ struct misc_config_s { int waypoint_formats; /* Which sentence formats should be generated? */ -#define WPT_FORMAT_NMEA_GENERIC 0x01 /* N $GPWPT */ -#define WPT_FORMAT_GARMIN 0x02 /* G $PGRMW */ -#define WPT_FORMAT_MAGELLAN 0x04 /* M $PMGNWPL */ -#define WPT_FORMAT_KENWOOD 0x08 /* K $PKWDWPL */ -#define WPT_FORMAT_AIS 0x10 /* A !AIVDM */ +#define WPL_FORMAT_NMEA_GENERIC 0x01 /* N $GPWPL */ +#define WPL_FORMAT_GARMIN 0x02 /* G $PGRMW */ +#define WPL_FORMAT_MAGELLAN 0x04 /* M $PMGNWPL */ +#define WPL_FORMAT_KENWOOD 0x08 /* K $PKWDWPL */ +#define WPL_FORMAT_AIS 0x10 /* A !AIVDM */ int log_daily_names; /* True to generate new log file each day. */ diff --git a/src/digipeater.h b/src/digipeater.h index 9885859..f45d54f 100644 --- a/src/digipeater.h +++ b/src/digipeater.h @@ -38,6 +38,12 @@ struct digi_config_s { enum preempt_e { PREEMPT_OFF, PREEMPT_DROP, PREEMPT_MARK, PREEMPT_TRACE } preempt[MAX_CHANS][MAX_CHANS]; + // NOID is an ugly hack for the specific need of ATGP which needs more that 8 digipeaters. + // The via path starts out as HOP7-7,HOP7-7 and we do not want tracing so it does not fill up. + // DO NOT put this in the User Guide. On a need to know basis. + + char noid[MAX_CHANS][MAX_CHANS][AX25_MAX_ADDR_LEN]; + char *filter_str[MAX_CHANS+1][MAX_CHANS+1]; // NULL or optional Packet Filter strings such as "t/m". // Notice the size of arrays is one larger than normal. diff --git a/src/direwolf.c b/src/direwolf.c index 1228612..146ca5f 100644 --- a/src/direwolf.c +++ b/src/direwolf.c @@ -299,7 +299,7 @@ int main (int argc, char *argv[]) text_color_init(t_opt); text_color_set(DW_COLOR_INFO); //dw_printf ("Dire Wolf version %d.%d (%s) Beta Test 4\n", MAJOR_VERSION, MINOR_VERSION, __DATE__); - dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "C", __DATE__); + dw_printf ("Dire Wolf DEVELOPMENT version %d.%d %s (%s)\n", MAJOR_VERSION, MINOR_VERSION, "D", __DATE__); //dw_printf ("Dire Wolf version %d.%d\n", MAJOR_VERSION, MINOR_VERSION); diff --git a/src/dlq.c b/src/dlq.c index b729e2e..0d4b4a4 100644 --- a/src/dlq.c +++ b/src/dlq.c @@ -130,12 +130,18 @@ void dlq_init (void) #else int err; err = pthread_mutex_init (&wake_up_mutex, NULL); + if (err != 0) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("dlq_init: pthread_mutex_init err=%d", err); + perror (""); + exit (EXIT_FAILURE); + } err = pthread_mutex_init (&dlq_mutex, NULL); if (err != 0) { text_color_set(DW_COLOR_ERROR); dw_printf ("dlq_init: pthread_mutex_init err=%d", err); perror (""); - exit (1); + exit (EXIT_FAILURE); } #endif @@ -253,6 +259,11 @@ void dlq_rec_frame (int chan, int subchan, int slice, packet_t pp, alevel_t alev /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; if (s_new_count > s_delete_count + 50) { @@ -492,6 +503,11 @@ void dlq_connect_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int num /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_CONNECT_REQUEST; @@ -545,6 +561,11 @@ void dlq_disconnect_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_DISCONNECT_REQUEST; @@ -603,6 +624,11 @@ void dlq_outstanding_frames_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LE /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_OUTSTANDING_FRAMES_REQUEST; @@ -670,6 +696,11 @@ void dlq_xmit_data_request (char addrs[AX25_MAX_ADDRS][AX25_MAX_ADDR_LEN], int n /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_XMIT_DATA_REQUEST; @@ -733,6 +764,11 @@ void dlq_register_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client) /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_REGISTER_CALLSIGN; @@ -763,6 +799,11 @@ void dlq_unregister_callsign (char addr[AX25_MAX_ADDR_LEN], int chan, int client /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_UNREGISTER_CALLSIGN; @@ -817,6 +858,11 @@ void dlq_channel_busy (int chan, int activity, int status) /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_CHANNEL_BUSY; @@ -865,6 +911,11 @@ void dlq_seize_confirm (int chan) /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; pnew->type = DLQ_SEIZE_CONFIRM; @@ -910,6 +961,11 @@ void dlq_client_cleanup (int client) /* Allocate a new queue item. */ pnew = (struct dlq_item_s *) calloc (sizeof(struct dlq_item_s), 1); + if (pnew == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } s_new_count++; // All we care about is the client number. @@ -1192,6 +1248,11 @@ cdata_t *cdata_new (int pid, char *data, int len) size = ( len + 127 ) & ~0x7f; cdata = malloc ( sizeof(cdata_t) + size ); + if (cdata == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } cdata->magic = TXDATA_MAGIC; cdata->next = NULL; diff --git a/src/kissnet.c b/src/kissnet.c index 44b3c7e..97094a0 100644 --- a/src/kissnet.c +++ b/src/kissnet.c @@ -263,6 +263,11 @@ void kissnet_init (struct misc_config_s *mc) for (int i = 0; i < MAX_KISS_TCP_PORTS; i++) { if (mc->kiss_port[i] != 0) { struct kissport_status_s *kps = calloc(sizeof(struct kissport_status_s), 1); + if (kps == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } kps->tcp_port = mc->kiss_port[i]; kps->chan = mc->kiss_chan[i]; diff --git a/src/log2gpx.c b/src/log2gpx.c index b13d80e..15d389f 100644 --- a/src/log2gpx.c +++ b/src/log2gpx.c @@ -258,8 +258,6 @@ static void read_csv(FILE *fp) float speed = UNKNOWN_VALUE; float course = UNKNOWN_VALUE; float alt = UNKNOWN_VALUE; - double freq = UNKNOWN_VALUE; - int offset = UNKNOWN_VALUE; char stemp[16], desc[32], comment[256]; if (pspeed != NULL && strlen(pspeed) > 0) { @@ -275,7 +273,7 @@ static void read_csv(FILE *fp) /* combine freq/offset/tone into one description string. */ if (pfreq != NULL && strlen(pfreq) > 0) { - freq = atof(pfreq); + double freq = atof(pfreq); snprintf (desc, sizeof(desc), "%.3f MHz", freq); } else { @@ -283,7 +281,7 @@ static void read_csv(FILE *fp) } if (poffset != NULL && strlen(poffset) > 0) { - offset = atoi(poffset); + int offset = atoi(poffset); if (offset != 0 && offset % 1000 == 0) { snprintf (stemp, sizeof(stemp), "%+dM", offset / 1000); } diff --git a/src/mheard.c b/src/mheard.c index eff4709..68f4b09 100644 --- a/src/mheard.c +++ b/src/mheard.c @@ -350,6 +350,11 @@ void mheard_save_rf (int chan, decode_aprs_t *A, packet_t pp, alevel_t alevel, r } mptr = calloc(sizeof(mheard_t),1); + if (mptr == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } strlcpy (mptr->callsign, source, sizeof(mptr->callsign)); mptr->count = 1; mptr->chan = chan; @@ -485,6 +490,11 @@ void mheard_save_is (char *ptext) } mptr = calloc(sizeof(mheard_t),1); + if (mptr == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } strlcpy (mptr->callsign, source, sizeof(mptr->callsign)); mptr->count = 1; mptr->last_heard_is = now; diff --git a/src/rrbb.c b/src/rrbb.c index 82d8aae..2047d69 100644 --- a/src/rrbb.c +++ b/src/rrbb.c @@ -88,7 +88,11 @@ rrbb_t rrbb_new (int chan, int subchan, int slice, int is_scrambled, int descram assert (slice >= 0 && slice < MAX_SLICERS); result = malloc(sizeof(struct rrbb_s)); - + if (result == NULL) { + text_color_set(DW_COLOR_ERROR); + dw_printf ("FATAL ERROR: Out of memory.\n"); + exit (EXIT_FAILURE); + } result->magic1 = MAGIC1; result->chan = chan; result->subchan = subchan; diff --git a/src/symbols.c b/src/symbols.c index 59a877d..68d393c 100644 --- a/src/symbols.c +++ b/src/symbols.c @@ -1,7 +1,7 @@ // // This file is part of Dire Wolf, an amateur radio packet TNC. // -// Copyright (C) 2011, 2012, 2013, 2014, 2015 John Langner, WB2OSZ +// Copyright (C) 2011, 2012, 2013, 2014, 2015, 2022 John Langner, WB2OSZ // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -556,6 +556,7 @@ static const char ssid_to_sym[16] = { 'v' /* 15 - Van */ }; + void symbols_from_dest_or_src (char dti, char *src, char *dest, char *symtab, char *symbol) { char *p; @@ -663,16 +664,30 @@ void symbols_from_dest_or_src (char dti, char *src, char *dest, char *symtab, ch * Chapter 20, "Symbol in the Source Address SSID" */ - p = strchr (src, '-'); - if (p != NULL) - { - int ssid; +// January 2022 - Every time this shows up, it confuses people terribly. +// e.g. An APRS "message" shows up with Bus or Motorcycle in the description. - ssid = atoi(p+1); - if (ssid >= 1 && ssid <= 15) { - *symtab = '/'; /* All in Primary table. */ - *symbol = ssid_to_sym[ssid]; - return; +// The position and object formats all contain a proper symbol and table. +// There doesn't seem to be much reason to have a symbol for something without +// a postion because it would not show up on a map. +// This just seems to be a remnant of something used long ago and no longer needed. +// The protocol spec mentions a "MIM tracker" but I can't find any references to it. + +// If this was completely removed, no one would probably ever notice. +// The only possible useful case I can think of would be someone sending a +// NMEA string directly from a GPS receiver and wanting to keep the destination field +// for the system type. + + if (dti == '$') { + + p = strchr (src, '-'); + if (p != NULL) { + int ssid = atoi(p+1); + if (ssid >= 1 && ssid <= 15) { + *symtab = '/'; /* All in Primary table. */ + *symbol = ssid_to_sym[ssid]; + return; + } } } diff --git a/src/tnctest.c b/src/tnctest.c index ed584e6..72b6f60 100644 --- a/src/tnctest.c +++ b/src/tnctest.c @@ -882,7 +882,7 @@ static void * tnc_thread_net (void *arg) // Expected message. Make sure it is expected sequence and send reply. int n = atoi(data); char reply[80]; - sprintf (reply, "%04d reply\r", n); + snprintf (reply, sizeof(reply), "%04d reply\r", n); tnc_send_data (my_index, 1 - my_index, reply); // HACK! @@ -896,7 +896,7 @@ static void * tnc_thread_net (void *arg) if (n == 1 && max_count > 1) { int j; for (j = 1; j <= 26; j++) { - sprintf (reply, "%.*s\r", j, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); + snprintf (reply, sizeof(reply), "%.*s\r", j, "ABCDEFGHIJKLMNOPQRSTUVWXYZ"); tnc_send_data (my_index, 1 - my_index, reply); } } @@ -992,7 +992,7 @@ static void * tnc_thread_serial (void *arg) // do any necessary set up here. such as setting mycall - sprintf (cmd, "mycall %s\r", tnc_address[my_index]); + snprintf (cmd, sizeof(cmd), "mycall %s\r", tnc_address[my_index]); serial_port_write (serial_fd[my_index], cmd, strlen(cmd)); SLEEP_MS (200); @@ -1094,7 +1094,7 @@ static void * tnc_thread_serial (void *arg) // Expected message. Make sure it is expected sequence and send reply. int n = atoi(result); char reply[80]; - sprintf (reply, "%04d reply\r", n); + snprintf (reply, sizeof(reply), "%04d reply\r", n); tnc_send_data (my_index, 1 - my_index, reply); } @@ -1151,7 +1151,7 @@ static void tnc_connect (int from, int to) SLEEP_MS (200); } - sprintf (cmd, "connect %s\r", tnc_address[to]); + snprintf (cmd, sizeof(cmd), "connect %s\r", tnc_address[to]); serial_port_write (serial_fd[from], cmd, strlen(cmd)); } diff --git a/src/tt_text.c b/src/tt_text.c index d5482d7..112adfe 100644 --- a/src/tt_text.c +++ b/src/tt_text.c @@ -470,7 +470,7 @@ int tt_text_to_call10 (const char *text, int quiet, char *buttons) char padded[8]; char stemp[11]; - + // FIXME: Add parameter for sizeof buttons and use strlcpy strcpy (buttons, ""); /* Quick validity check. */ @@ -540,6 +540,7 @@ int tt_text_to_call10 (const char *text, int quiet, char *buttons) /* Binary to decimal for the columns. */ snprintf (stemp, sizeof(stemp), "%04d", packed); + // FIXME: add parameter for sizeof buttons and use strlcat strcat (buttons, stemp); return (errors); @@ -1435,6 +1436,7 @@ int tt_satsq_to_text (const char *buttons, int quiet, char *text) row = buttons[0] - '0'; col = buttons[1] - '0'; + // FIXME: Add parameter for sizeof text and use strlcpy, strlcat. strcpy (text, grid[row][col]); strcat (text, buttons+2); @@ -1603,11 +1605,11 @@ int main (int argc, char *argv[]) exit (1); } - strcpy (text, argv[1]); + strlcpy (text, argv[1], sizeof(text)); for (n = 2; n < argc; n++) { - strcat (text, " "); - strcat (text, argv[n]); + strlcat (text, " ", sizeof(text)); + strlcat (text, argv[n], sizeof(text)); } dw_printf ("Push buttons for multi-press method:\n"); @@ -1670,7 +1672,7 @@ int main (int argc, char *argv[]) exit (1); } - strcpy (buttons, argv[1]); + strlcpy (buttons, argv[1], sizeof(buttons)); for (n = 2; n < argc; n++) { strlcat (buttons, argv[n], sizeof(buttons)); diff --git a/src/ttcalc.c b/src/ttcalc.c index 51952b9..a031ec0 100644 --- a/src/ttcalc.c +++ b/src/ttcalc.c @@ -187,7 +187,7 @@ int main (int argc, char *argv[]) ax25_format_addrs (pp, result); info_len = ax25_get_info (pp, (unsigned char **)(&pinfo)); pinfo[info_len] = '\0'; - strcat (result, pinfo); + strlcat (result, pinfo, sizeof(result)); for (p=result; *p!='\0'; p++) { if (! isprint(*p)) *p = ' '; } diff --git a/src/waypoint.c b/src/waypoint.c index c06b362..70ea320 100644 --- a/src/waypoint.c +++ b/src/waypoint.c @@ -187,10 +187,10 @@ void waypoint_init (struct misc_config_s *mc) s_waypoint_formats = mc->waypoint_formats; if (s_waypoint_formats == 0) { - s_waypoint_formats = WPT_FORMAT_NMEA_GENERIC | WPT_FORMAT_KENWOOD; + s_waypoint_formats = WPL_FORMAT_NMEA_GENERIC | WPL_FORMAT_KENWOOD; } - if (s_waypoint_formats & WPT_FORMAT_GARMIN) { - s_waypoint_formats |= WPT_FORMAT_NMEA_GENERIC; /* See explanation below. */ + if (s_waypoint_formats & WPL_FORMAT_GARMIN) { + s_waypoint_formats |= WPL_FORMAT_NMEA_GENERIC; /* See explanation below. */ } #if DEBUG @@ -376,7 +376,7 @@ void waypoint_send_sentence (char *name_in, double dlat, double dlong, char symt * *99 is checksum */ - if (s_waypoint_formats & WPT_FORMAT_NMEA_GENERIC) { + if (s_waypoint_formats & WPL_FORMAT_NMEA_GENERIC) { snprintf (sentence, sizeof(sentence), "$GPWPL,%s,%s,%s,%s,%s", slat, slat_ns, slong, slong_ew, wname); append_checksum (sentence); @@ -406,7 +406,7 @@ void waypoint_send_sentence (char *name_in, double dlat, double dlong, char symt * *99 is checksum */ - if (s_waypoint_formats & WPT_FORMAT_GARMIN) { + if (s_waypoint_formats & WPL_FORMAT_GARMIN) { int i = symbol - ' '; int grm_sym; /* Garmin symbol code. */ @@ -455,7 +455,7 @@ void waypoint_send_sentence (char *name_in, double dlat, double dlong, char symt * to delete that specific waypoint. */ - if (s_waypoint_formats & WPT_FORMAT_MAGELLAN) { + if (s_waypoint_formats & WPL_FORMAT_MAGELLAN) { int i = symbol - ' '; char sicon[3]; /* Magellan icon string. Currently 1 or 2 characters. */ @@ -567,7 +567,7 @@ void waypoint_send_sentence (char *name_in, double dlat, double dlong, char symt - if (s_waypoint_formats & WPT_FORMAT_KENWOOD) { + if (s_waypoint_formats & WPL_FORMAT_KENWOOD) { time_t now; struct tm tm; @@ -654,7 +654,7 @@ void waypoint_send_ais (char *sentence) return; } - if (s_waypoint_formats & WPT_FORMAT_AIS) { + if (s_waypoint_formats & WPL_FORMAT_AIS) { send_sentence (sentence); } }