MCPcopy Create free account
hub / github.com/Hamlib/Hamlib / amp_sprintf_level

Function amp_sprintf_level

src/sprintflst.c:318–345  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

316
317
318int amp_sprintf_level(char *str, int nlen, setting_t level)
319{
320 int i, len = 0;
321
322 *str = '\0';
323
324 if (level == AMP_LEVEL_NONE)
325 {
326 return 0;
327 }
328
329 for (i = 0; i < RIG_SETTING_MAX; i++)
330 {
331 const char *ms = amp_strlevel(level & rig_idx2setting(i));
332
333 if (!ms || !ms[0])
334 {
335 continue; /* unknown, FIXME! */
336 }
337
338 strcat(str, ms);
339 strcat(str, " ");
340 len += strlen(ms) + 1;
341 check_buffer_overflow(str, len, nlen);
342 }
343
344 return len;
345}
346
347
348int sprintf_level_ext(char *str, int nlen, const struct confparams *extlevels)

Callers 2

ampctl_parse.cFile · 0.85
dumpcaps_ampFunction · 0.85

Calls 3

amp_strlevelFunction · 0.85
rig_idx2settingFunction · 0.85
check_buffer_overflowFunction · 0.85

Tested by

no test coverage detected