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

Function _substrcmp

tools/ipfw/ipfw2.c:825–836  ·  view source on GitHub ↗

* _substrcmp takes two strings and returns 1 if they do not match, * and 0 if they match exactly or the first string is a sub-string * of the second. A warning is printed to stderr in the case that the * first string is a sub-string of the second. * * This function will be removed in the future through the usual * deprecation process. */

Source from the content-addressed store, hash-verified

823 * deprecation process.
824 */
825int
826_substrcmp(const char *str1, const char* str2)
827{
828
829 if (strncmp(str1, str2, strlen(str1)) != 0)
830 return 1;
831
832 if (strlen(str1) != strlen(str2))
833 warnx("DEPRECATED: '%s' matched '%s' as a sub-string",
834 str1, str2);
835 return 0;
836}
837
838/*
839 * _substrcmp2 takes three strings and returns 1 if the first two do not match,

Callers 8

main.cFile · 0.85
ipfw_sets_handlerFunction · 0.85
ipfw_sysctl_handlerFunction · 0.85
fill_ipFunction · 0.85
ipfw_deleteFunction · 0.85
add_protoFunction · 0.85
add_proto_compatFunction · 0.85
compile_ruleFunction · 0.85

Calls 1

strncmpFunction · 0.85

Tested by

no test coverage detected