Rename COPYING -> LICENSE.
[libradsec.git] / lib / util.c
1 /* Copyright 2012 NORDUnet A/S. All rights reserved.
2    See LICENSE for licensing information.  */
3
4 #include <string.h>
5 #include <radsec/radsec.h>
6 #include <radsec/radsec-impl.h>
7 #include "util.h"
8
9 char *
10 rs_strdup (struct rs_context *ctx, const char *s)
11 {
12   char *buf = rs_calloc (ctx, 1, strlen (s) + 1);
13
14   if (buf != NULL)
15     return strcpy (buf, s);
16
17   rs_err_ctx_push (ctx, RSE_NOMEM, NULL);
18   return NULL;
19 }