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

Function concat_tokens

tools/ipfw/ipfw2.c:743–761  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

741}
742
743size_t
744concat_tokens(char *buf, size_t bufsize, struct _s_x *table,
745 const char *delimiter)
746{
747 struct _s_x *pt;
748 int l;
749 size_t sz;
750
751 for (sz = 0, pt = table ; pt->s != NULL; pt++) {
752 l = snprintf(buf + sz, bufsize - sz, "%s%s",
753 (sz == 0) ? "" : delimiter, pt->s);
754 sz += l;
755 bufsize += l;
756 if (sz > bufsize)
757 return (bufsize);
758 }
759
760 return (sz);
761}
762
763/*
764 * helper function to process a set of flags and set bits in the

Callers 1

table_createFunction · 0.85

Calls 1

snprintfFunction · 0.85

Tested by

no test coverage detected