Back to index

opendkim  2.6.2
Functions
dkim-strl.c File Reference
#include <sys/types.h>
#include <string.h>
#include "build-config.h"

Go to the source code of this file.

Functions

size_t dkim_strlcpy (char *dst, const char *src, ssize_t size)
size_t dkim_strlcat (char *dst, const char *src, ssize_t size)

Function Documentation

size_t dkim_strlcat ( char *  dst,
const char *  src,
ssize_t  size 
)

Definition at line 102 of file dkim-strl.c.

{
       register ssize_t i, j, o;

       o = strlen(dst);
       if (size < o + 1)
              return o + strlen(src);
       size -= o + 1;
       for (i = 0, j = o; i < size && (dst[j] = src[i]) != 0; i++, j++)
              continue;
       dst[j] = '\0';
       if (src[i] == '\0')
              return j;
       else
              return j + strlen(src + i);
}

Here is the caller graph for this function:

size_t dkim_strlcpy ( char *  dst,
const char *  src,
ssize_t  size 
)

Definition at line 56 of file dkim-strl.c.

{
       register ssize_t i;

       if (size-- <= 0)
              return strlen(src);
       for (i = 0; i < size && (dst[i] = src[i]) != 0; i++)
              continue;
       dst[i] = '\0';
       if (src[i] == '\0')
              return i;
       else
              return i + strlen(src + i);
}

Here is the caller graph for this function: