Skip to content
Snippets Groups Projects
Commit abd21e95 authored by Daniel Salzman's avatar Daniel Salzman
Browse files

contrig: fix multiple definition if static compilation

parent 596a5915
No related branches found
No related tags found
No related merge requests found
Pipeline #
......@@ -20,7 +20,6 @@
#include <string.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <contrib/string.c>
#include "binary.h"
#include "error.h"
......@@ -45,7 +44,16 @@ typedef struct pkcs8_dir_handle {
/*!
* Get path to a private key in PKCS #8 PEM format.
*/
#define key_path(dir, id) sprintf_alloc("%s/%s.pem", dir, id)
static char *key_path(const char *dir, const char *id)
{
char *strp = NULL;
int ret = asprintf(&strp, "%s/%s.pem", dir, id);
if (ret < 0) {
return NULL;
}
return strp;
}
/*!
* Get size of the file and reset the position to the beginning of the file.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment