summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
41c230c)
Replacing a hand-coded memset with a function call, using static space
instead of stack space for an array.
Signed-off-by: Keith Packard <keithp@keithp.com>
ao_config_callsign_set(void) __reentrant
{
uint8_t c;
ao_config_callsign_set(void) __reentrant
{
uint8_t c;
- char callsign[AO_MAX_CALLSIGN + 1];
+ static __xdata char callsign[AO_MAX_CALLSIGN + 1];
+ memset(callsign, '\0', sizeof callsign);
ao_cmd_white();
c = 0;
while (ao_cmd_lex_c != '\n') {
ao_cmd_white();
c = 0;
while (ao_cmd_lex_c != '\n') {
return;
ao_mutex_get(&ao_config_mutex);
_ao_config_get();
return;
ao_mutex_get(&ao_config_mutex);
_ao_config_get();
- while (c < AO_MAX_CALLSIGN + 1)
- callsign[c++] = '\0';
memcpy(&ao_config.callsign, &callsign,
AO_MAX_CALLSIGN + 1);
ao_config_dirty = 1;
memcpy(&ao_config.callsign, &callsign,
AO_MAX_CALLSIGN + 1);
ao_config_dirty = 1;