summaryrefslogtreecommitdiff
path: root/sutils
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-01 13:53:31 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2022-01-01 18:05:00 +0100
commita8d51bf0ce26fd26e00338540857f43b8a99e126 (patch)
tree917f249fbf6873280161959c74a71b8edb0f4cea /sutils
parente2b75a67395fbbdd36bb0bceaea2465a2a1fa172 (diff)
Fix build warnings
No actual behavior change.
Diffstat (limited to 'sutils')
-rw-r--r--sutils/clookup.c8
1 files changed, 5 insertions, 3 deletions
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