| 226 | |
| 227 | |
| 228 | int rot_sprintf_func(char *str, int nlen, setting_t func) |
| 229 | { |
| 230 | unsigned int i, len = 0; |
| 231 | |
| 232 | *str = '\0'; |
| 233 | |
| 234 | if (func == ROT_FUNC_NONE) |
| 235 | { |
| 236 | return 0; |
| 237 | } |
| 238 | |
| 239 | for (i = 0; i < RIG_SETTING_MAX; i++) |
| 240 | { |
| 241 | const char *ms = rot_strfunc(func & rig_idx2setting(i)); |
| 242 | |
| 243 | if (!ms || !ms[0]) |
| 244 | { |
| 245 | continue; /* unknown, FIXME! */ |
| 246 | } |
| 247 | |
| 248 | strcat(str, ms); |
| 249 | strcat(str, " "); |
| 250 | len += strlen(ms) + 1; |
| 251 | check_buffer_overflow(str, len, nlen); |
| 252 | } |
| 253 | |
| 254 | return len; |
| 255 | } |
| 256 | |
| 257 | |
| 258 | int rig_sprintf_level(char *str, int nlen, setting_t level) |
no test coverage detected