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

Function rot_sprintf_level

src/sprintflst.c:288–315  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

286
287
288int rot_sprintf_level(char *str, int nlen, setting_t level)
289{
290 int i, len = 0;
291
292 *str = '\0';
293
294 if (level == ROT_LEVEL_NONE)
295 {
296 return 0;
297 }
298
299 for (i = 0; i < RIG_SETTING_MAX; i++)
300 {
301 const char *ms = rot_strlevel(level & rig_idx2setting(i));
302
303 if (!ms || !ms[0])
304 {
305 continue; /* unknown, FIXME! */
306 }
307
308 strcat(str, ms);
309 strcat(str, " ");
310 len += strlen(ms) + 1;
311 check_buffer_overflow(str, len, nlen);
312 }
313
314 return len;
315}
316
317
318int amp_sprintf_level(char *str, int nlen, setting_t level)

Callers 1

rotctl_parse.cFile · 0.85

Calls 3

rot_strlevelFunction · 0.85
rig_idx2settingFunction · 0.85
check_buffer_overflowFunction · 0.85

Tested by

no test coverage detected