From 5cacb3f241468907e31245da7d14aa156d68ff25 Mon Sep 17 00:00:00 2001 From: Andrew Alderwick Date: Mon, 2 Jan 2023 15:23:28 +0000 Subject: [PATCH] Fix macOS build. --- src/devices/file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/devices/file.c b/src/devices/file.c index 3f7144e..08b39e9 100644 --- a/src/devices/file.c +++ b/src/devices/file.c @@ -132,7 +132,9 @@ retry_realpath(const char *file_name) else return NULL; } - return strdup(r); + x = malloc(strlen(r) + 1); + strcpy(x, r); + return x; } static void