2021-01-17 21:11:59 +08:00
|
|
|
#include "compat.h"
|
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2021-11-25 02:37:33 +08:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <string.h>
|
|
|
|
|
2021-01-17 21:11:59 +08:00
|
|
|
#ifndef HAVE_STRDUP
|
|
|
|
char *strdup(const char *s) {
|
|
|
|
size_t size = strlen(s) + 1;
|
|
|
|
char *dup = malloc(size);
|
|
|
|
if (dup) {
|
|
|
|
memcpy(dup, s, size);
|
|
|
|
}
|
|
|
|
return dup;
|
|
|
|
}
|
|
|
|
#endif
|