From: Keith Packard Date: Fri, 26 Aug 2011 01:02:45 +0000 (-0700) Subject: altos: Clear callsign on initial config load X-Git-Tag: 1.0.1~6^2 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=3bfe8df44b575ca430ffaa051e20faa955a06c03;hp=-c altos: Clear callsign on initial config load Before being written the first time, ao_config will get set to 0xff when the config storage is read. This leaves the tail of the callsign filled with invalid bytes. Zero the whole thing before loading the default callsign to make sure any extra bytes are set correctly. Signed-off-by: Keith Packard --- 3bfe8df44b575ca430ffaa051e20faa955a06c03 diff --git a/src/ao_config.c b/src/ao_config.c index eb1eea3f..0c10e608 100644 --- a/src/ao_config.c +++ b/src/ao_config.c @@ -74,6 +74,7 @@ _ao_config_get(void) ao_config.minor = 0; ao_config.main_deploy = AO_CONFIG_DEFAULT_MAIN_DEPLOY; ao_config.radio_channel = AO_CONFIG_DEFAULT_RADIO_CHANNEL; + memset(&ao_config.callsign, '\0', sizeof (ao_config.callsign)); memcpy(&ao_config.callsign, AO_CONFIG_DEFAULT_CALLSIGN, sizeof(AO_CONFIG_DEFAULT_CALLSIGN) - 1); }