kopia lustrzana https://github.com/Hamlib/Hamlib
dummy/dummy.c: Fix unaligned access in dummy_get_level()
This fixes an unaligned access in dummy/dummy.c in the function dummy_get_level() which resulted in crashes (Bus Error) on systems with stricter alignment requirements such as SPARC. On x86_64 (and any other architecture with less strict alignment requirements), the compiler automatically optimizes the memcpy() out if necessary such that there are no performance issues.pull/497/head
rodzic
cf858bfa3c
commit
5805de6e1e
|
@ -1123,7 +1123,7 @@ static int dummy_get_level(RIG *rig, vfo_t vfo, setting_t level, value_t *val)
|
|||
break;
|
||||
}
|
||||
|
||||
*val = curr->levels[idx];
|
||||
memcpy (val, &curr->levels[idx], sizeof(value_t));
|
||||
rig_debug(RIG_DEBUG_VERBOSE, "%s called: %s\n", __func__,
|
||||
rig_strlevel(level));
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue