MCPcopy Create free account
hub / github.com/F-Stack/f-stack / print_flags_buffer

Function print_flags_buffer

tools/ipfw/ipfw2.c:796–814  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

794}
795
796void
797print_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,

Callers 2

table_print_typeFunction · 0.85
table_print_valheaderFunction · 0.85

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected