Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
#define _TO_STRING(x) #x
#define TO_STRING(x) _TO_STRING(x)
+// Maximum length of an architecture name
+#define ARCH_MAX 16
+
#define STRING_SIZE 1024
#define PAKFIRE_REPO_SYSTEM_NAME "@system"
struct _Pakfire {
char path[PATH_MAX];
char cache_path[PATH_MAX];
- char* arch;
+ char arch[ARCH_MAX];
// Pool stuff
Pool* pool;
snprintf(p->path, sizeof(p->path) - 1, "%s", path);
// Set architecture
- p->arch = strdup(arch);
+ snprintf(p->arch, sizeof(p->arch) - 1, "%s", arch);
// Setup logging
p->log_function = pakfire_log_syslog;