diff options
author | Mike Frysinger <vapier@gentoo.org> | 2007-04-17 22:31:01 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2007-04-17 22:31:01 +0000 |
commit | a77c1608a45b4c8870d9e98b2ee44ed7228646ca (patch) | |
tree | 510136ddfcf02ec110fa0e334527b0924959d737 /utils/chroot_realpath.c | |
parent | 338053615c6e1504a290355c66e105826ae9e51f (diff) | |
download | uClibc-alpine-a77c1608a45b4c8870d9e98b2ee44ed7228646ca.tar.bz2 uClibc-alpine-a77c1608a45b4c8870d9e98b2ee44ed7228646ca.tar.xz |
cleanup style; no functional changes
Diffstat (limited to 'utils/chroot_realpath.c')
-rw-r--r-- | utils/chroot_realpath.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/utils/chroot_realpath.c b/utils/chroot_realpath.c index dd33c3fc0..0785c6c5b 100644 --- a/utils/chroot_realpath.c +++ b/utils/chroot_realpath.c @@ -29,14 +29,14 @@ #include <stdio.h> #include <string.h> #include <strings.h> -#include <limits.h> /* for PATH_MAX */ -#include <sys/param.h> /* for MAXPATHLEN */ +#include <limits.h> /* for PATH_MAX */ +#include <sys/param.h> /* for MAXPATHLEN */ #include <errno.h> #ifndef __set_errno #define __set_errno(val) ((errno) = (val)) #endif -#include <sys/stat.h> /* for S_IFLNK */ +#include <sys/stat.h> /* for S_IFLNK */ #ifndef PATH_MAX #define PATH_MAX _POSIX_PATH_MAX @@ -44,7 +44,8 @@ #define MAX_READLINKS 32 -char *chroot_realpath(const char *chroot, const char *path, char resolved_path[]) +char *chroot_realpath(const char *chroot, const char *path, + char resolved_path[]) { char copy_path[PATH_MAX]; char link_path[PATH_MAX]; @@ -103,7 +104,7 @@ char *chroot_realpath(const char *chroot, const char *path, char resolved_path[] if (new_path == got_path_root + 1) continue; /* Handle ".." by backing up. */ - while ((--new_path)[-1] != '/'); + while ((--new_path)[-1] != '/') ; continue; } } @@ -144,7 +145,7 @@ char *chroot_realpath(const char *chroot, const char *path, char resolved_path[] new_path = got_path_root; else /* Otherwise back up over this component. */ - while (*(--new_path) != '/'); + while (*(--new_path) != '/') ; /* Safe sex check. */ if (strlen(path) + n >= PATH_MAX - 2) { __set_errno(ENAMETOOLONG); @@ -155,7 +156,7 @@ char *chroot_realpath(const char *chroot, const char *path, char resolved_path[] strcpy(copy_path, link_path); path = copy_path; } -#endif /* S_IFLNK */ +#endif /* S_IFLNK */ *new_path++ = '/'; } /* Delete trailing slash but don't whomp a lone slash. */ |