| 794 | } |
| 795 | |
| 796 | void |
| 797 | print_flags_buffer(char *buf, size_t sz, struct _s_x *list, uint32_t set) |
| 798 | { |
| 799 | char const *comma = ""; |
| 800 | int i, l; |
| 801 | |
| 802 | for (i = 0; list[i].x != 0; i++) { |
| 803 | if ((set & list[i].x) == 0) |
| 804 | continue; |
| 805 | |
| 806 | set &= ~list[i].x; |
| 807 | l = snprintf(buf, sz, "%s%s", comma, list[i].s); |
| 808 | if (l < 0 || (size_t)l >= sz) |
| 809 | return; |
| 810 | comma = ","; |
| 811 | buf += l; |
| 812 | sz -=l; |
| 813 | } |
| 814 | } |
| 815 | |
| 816 | /* |
| 817 | * _substrcmp takes two strings and returns 1 if they do not match, |
no test coverage detected