xstring.cc File Reference
#include "squid.h"
#include "compat/xalloc.h"
#include "compat/xstring.h"
#include <cerrno>
Include dependency graph for xstring.cc:

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()

◆ 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().

 

Introduction

Documentation

Support

Miscellaneous

Web Site Translations

Mirrors