/[imapfilter]/imapfilter/misc.c
ViewVC logotype

Diff of /imapfilter/misc.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by lefcha, Tue Nov 6 17:42:57 2001 UTC revision 1.3 by lefcha, Thu Nov 8 17:27:17 2001 UTC
# Line 69  char *ultostr(unsigned long int num, int Line 69  char *ultostr(unsigned long int num, int
69    
70      return c;      return c;
71  }  }
72    
73    
74    /*
75     * Copies at most size characters from the string pointed by src to the
76     * array pointed by dest, always NULL terminating (unless size == 0).
77     * Returns pointer to dest.
78     */
79    char *xstrncpy(char *dest, char *src, size_t size)
80    {
81        char *d = dest;
82        char *s = src;
83        size_t n = size;
84    
85        while (n) {
86            if (!(*d++ = *s++))
87                break;
88            n--;
89        }
90    
91        if (!n && size)
92            *d = 0;
93    
94        return dest;
95    }

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

webmaster@linux.gr
ViewVC Help
Powered by ViewVC 1.1.26