From a8d51bf0ce26fd26e00338540857f43b8a99e126 Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sat, 1 Jan 2022 13:53:31 +0100 Subject: Fix build warnings No actual behavior change. --- sutils/clookup.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sutils') diff --git a/sutils/clookup.c b/sutils/clookup.c index 1858efb9..ec1799dd 100644 --- a/sutils/clookup.c +++ b/sutils/clookup.c @@ -56,12 +56,14 @@ file_name_lookup_carefully (const char *name, int flags, mode_t mode) mach_port_t *node) { error_t err; - const char *tail; - char *slash = index (name, '/'), *head; + const char *head, *tail; + char *slash = index (name, '/'); if (slash) { - *stpncpy (head = alloca (slash - name + 1), name, slash - name) = 0; + char *str = alloca (slash - name + 1); + *stpncpy (str, name, slash - name) = 0; + head = str; tail = slash + 1; } else -- cgit v1.2.3