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

Function parse_fail_point

freebsd/kern/kern_fail.c:974–996  ·  view source on GitHub ↗

* Internal helper function to translate a human-readable failpoint string * into a internally-parsable fail_point structure. */

Source from the content-addressed store, hash-verified

972 * into a internally-parsable fail_point structure.
973 */
974static char *
975parse_fail_point(struct fail_point_setting *ents, char *p)
976{
977 /* <fail_point> ::
978 * <term> ( "->" <term> )*
979 */
980 uint8_t term_count;
981
982 term_count = 1;
983
984 p = parse_term(ents, p);
985 if (p == NULL)
986 return (NULL);
987
988 while (*p != '\0') {
989 term_count++;
990 if (p[0] != '-' || p[1] != '>' ||
991 (p = parse_term(ents, p+2)) == NULL ||
992 term_count > FP_MAX_ENTRY_COUNT)
993 return (NULL);
994 }
995 return (p);
996}
997
998/**
999 * Internal helper function to parse an individual term from a failpoint.

Callers 1

fail_point_setFunction · 0.85

Calls 1

parse_termFunction · 0.85

Tested by

no test coverage detected