Changeset a6c0875f1e96a54710d7016a79d0edf5f6594441

Show
Ignore:
Timestamp:
08/12/08 01:32:27 (6 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1218504747 +0000
git-parent:

[195b6deb309ee2b12b47ac368b50d3ab720e3bf4]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1218504747 +0000
Message:

reimplement without strlcpy, refs #51

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/stratcon_datastore.c

    r195b6de ra6c0875  
    130130static char * 
    131131__noit__strndup(const char *src, int len) { 
     132  int slen; 
    132133  char *dst; 
    133   dst = malloc(len + 1); 
    134   strlcpy(dst, src, len); 
    135   dst[len] = '\0'; 
     134  for(slen = 0; slen < len; slen++) 
     135    if(src[slen] == '\0') break; 
     136  dst = malloc(slen + 1); 
     137  memcpy(dst, src, slen); 
     138  dst[slen] = '\0'; 
    136139  return dst; 
    137140}