Lines Matching refs:cstr

666 mDNSexport mDNSu8 *AppendLiteralLabelString(domainname *const name, const char *cstr)
674 while (*cstr && ptr < lim) *ptr++ = (mDNSu8)*cstr++; // Copy the data
677 if (*cstr) return(mDNSNULL); // Failure: We didn't successfully consume all input
690 const char *cstr = cstring;
693 while (*cstr && ptr < lim) // While more characters, and space to put them...
696 if (*cstr == '.') { LogMsg("AppendDNSNameString: Illegal empty label in name \"%s\"", cstring); return(mDNSNULL); }
697 while (*cstr && *cstr != '.' && ptr < lim) // While we have characters in the label...
699 mDNSu8 c = (mDNSu8)*cstr++; // Read the character
702 c = (mDNSu8)*cstr++; // Assume we'll just take the next character
703 if (mdnsIsDigit(cstr[-1]) && mdnsIsDigit(cstr[0]) && mdnsIsDigit(cstr[1]))
705 int v0 = cstr[-1] - '0'; // then interpret as three-digit decimal
706 int v1 = cstr[ 0] - '0';
707 int v2 = cstr[ 1] - '0';
709 if (val <= 255) { c = (mDNSu8)val; cstr += 2; } // If valid three-digit decimal value, use it
714 if (*cstr) cstr++; // Skip over the trailing dot (if present)
721 if (*cstr) return(mDNSNULL); // Failure: We didn't successfully consume all input
768 mDNSexport mDNSBool MakeDomainLabelFromLiteralString(domainlabel *const label, const char *cstr)
772 while (*cstr && ptr < limit) *ptr++ = (mDNSu8)*cstr++; // Copy the label
774 return(*cstr == 0); // Return mDNStrue if we successfully consumed all input
784 mDNSexport mDNSu8 *MakeDomainNameFromDNSNameString(domainname *const name, const char *cstr)
787 return(AppendDNSNameString(name, cstr)); // And then add this string to it
817 // Note: To guarantee that there will be no possible overrun, cstr must be at least MAX_ESCAPED_DOMAIN_NAME (1005 bytes)