| 192 | } |
| 193 | |
| 194 | int rig_sprintf_func(char *str, int nlen, setting_t func) |
| 195 | { |
| 196 | unsigned int i, len = 0; |
| 197 | |
| 198 | *str = '\0'; |
| 199 | |
| 200 | if (func == RIG_FUNC_NONE) |
| 201 | { |
| 202 | return 0; |
| 203 | } |
| 204 | |
| 205 | for (i = 0; i < RIG_SETTING_MAX; i++) |
| 206 | { |
| 207 | const char *ms = rig_strfunc(func & rig_idx2setting(i)); |
| 208 | |
| 209 | if (!ms) |
| 210 | { |
| 211 | rig_debug(RIG_DEBUG_ERR, "%s: unknown RIG_FUNC=%x\n", __func__, i); |
| 212 | continue; /* unknown, FIXME! */ |
| 213 | } |
| 214 | |
| 215 | if (ms[0]) |
| 216 | { |
| 217 | strcat(str, ms); |
| 218 | strcat(str, " "); |
| 219 | len += strlen(ms) + 1; |
| 220 | check_buffer_overflow(str, len, nlen); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | return len; |
| 225 | } |
| 226 | |
| 227 | |
| 228 | int rot_sprintf_func(char *str, int nlen, setting_t func) |
no test coverage detected