* added RCS Id keyword strings to sources
[citadel.git] / citadel / tools.c
1 /*
2  * tools.c -- Miscellaneous routines used by both the client and server.
3  * $Id$
4  */
5
6 #include <stdio.h>
7 #include <stdlib.h>
8 #include <string.h>
9 #include "tools.h"
10
11 char *safestrncpy(char *dest, const char *src, size_t n)
12 {
13   if (dest == NULL || src == NULL)
14     {
15       fprintf(stderr, "safestrncpy: NULL argument\n");
16       abort();
17     }
18   strncpy(dest, src, n);
19   dest[n - 1] = 0;
20   return dest;
21 }