Go to the source code of this file.
Functions | |
char * | xstrdup (const char *s) |
char * | xstrncpy (char *dst, const char *src, size_t n) |
char * | xstrndup (const char *s, size_t n) |
Function Documentation
◆ xstrdup()
char * xstrdup | ( | const char * | s | ) |
xstrdup() - same as strdup(3). Used for portability. Never returns nullptr; fatal on error.
Sets errno to EINVAL if a nullptr pointer is passed.
Define failure_notify to receive error message. otherwise perror() is used to display it.
Definition at line 16 of file xstring.cc.
References failure_notify, and xmalloc.
◆ xstrncpy()
char * xstrncpy | ( | char * | dst, |
const char * | src, | ||
size_t | n | ||
) |
Definition at line 37 of file xstring.cc.
Referenced by Logfile::Logfile(), Acl::NotNode::NotNode(), accessLogLogTo(), String::append(), BindLDAP(), Ftp::Gateway::checkAuth(), clientIdentDone(), ACL::context(), DiskdFile::create(), ESIContext::end(), EvalBoolExpr(), fd_note(), Ssl::findIssuerUri(), getfullhostname(), getStringPrefix(), AnyP::Uri::host(), InitLDAP(), internalHostname(), internalRemoteUri(), LDAPHHA1(), local_printfx(), Fs::Ufs::UFSSwapDir::logFile(), IdentLookup::LookupDone(), MainSafe(), mainStartScript(), mimeInit(), DiskdFile::open(), OpenLDAP(), Format::Token::parse(), AnyP::Uri::parse(), parse_date(), parse_wccp2_service(), ACL::ParseAclLine(), Ftp::Client::parseControlReply(), Ftp::Gateway::parseListing(), parseOneConfigFile(), ESIContext::parserComment(), Ipc::PathToAddress(), ResetLDAP(), HierarchyLogEntry::resetPeerNotes(), rfc1035BuildAQuery(), rfc1035BuildPTRQuery(), rfc3596BuildHostQuery(), SearchFilterLDAP(), SearchIPLDAP(), SearchLDAP(), ACLFilledChecklist::setIdent(), Comm::TcpAcceptor::setListen(), SMB_Negotiate(), SMB_TreeConnect(), ESIContext::start(), TextHHA1(), unlinkdUnlink(), DiskdIOStrategy::unlinkFile(), ConfigParser::UnQuote(), urlCanonicalCleanWithoutRequest(), Valid_Global_Groups(), Valid_User(), wccp2_add_service_list(), wccp2_check_security(), wccp2_update_md5_security(), and xstrndup().
◆ xstrndup()
char * xstrndup | ( | const char * | s, |
size_t | n | ||
) |
xstrndup() - Somewhat similar(XXX) to strndup(3): Allocates up to n bytes, while strndup(3) copies up to n bytes and allocates up to n+1 bytes to fit the terminating character. Assumes s is 0-terminated (another XXX).
Never returns nullptr; fatal on error.
Sets errno to EINVAL if a nullptr pointer or negative length is passed.
Define failure_notify to receive error message. otherwise perror() is used to display it.
Definition at line 56 of file xstring.cc.
References failure_notify, xmalloc, and xstrncpy().
Referenced by ESIVariableQuery::ESIVariableQuery(), ESIVariableUserAgent::ESIVariableUserAgent(), AnyP::Uri::cleanup(), ESIVariableProcessor::doFunction(), ftpListParseParts(), ESIVariableUserAgent::getProductVersion(), getsymbol(), munge_menu_line(), Adaptation::Icap::Options::TransferList::parse(), HttpHdrSc::parse(), process_options(), ClientHttpRequest::setErrorUri(), ClientHttpRequest::setLogUriToRequestUri(), and ConfigParser::TokenParse().