diff options
Diffstat (limited to 'sutils')
-rw-r--r-- | sutils/clookup.c | 8 |
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 |