GRU - Generic Reusable Utilities
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
gru_alt.c File Reference
#include "gru_alt.h"

Functions

size_t strlcpy (char *dst, const char *src, size_t len)
 
size_t strlcat (char *gru_restrict dst, const char *gru_restrict src, size_t size)
 Poor man's implementation of strlcat. More...
 
char * strndup (const char *source, size_t limit)
 Poor man's implementation of strndup (duplicate a string) More...
 

Function Documentation

size_t strlcat ( char *gru_restrict  dst,
const char *gru_restrict  src,
size_t  size 
)

Poor man's implementation of strlcat.

Parameters
dstdestination buffer
srcsource buffer
sizeamount of bytes to copy
Returns
The total length of the string they tried to create
size_t strlcpy ( char *  dst,
const char *  src,
size_t  len 
)
char* strndup ( const char *  source,
size_t  limit 
)

Poor man's implementation of strndup (duplicate a string)

Parameters
sourcesource string
limitmaximum number of bytes to copy