From a77c1608a45b4c8870d9e98b2ee44ed7228646ca Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Tue, 17 Apr 2007 22:31:01 +0000 Subject: cleanup style; no functional changes --- utils/chroot_realpath.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'utils/chroot_realpath.c') 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 #include #include -#include /* for PATH_MAX */ -#include /* for MAXPATHLEN */ +#include /* for PATH_MAX */ +#include /* for MAXPATHLEN */ #include #ifndef __set_errno #define __set_errno(val) ((errno) = (val)) #endif -#include /* for S_IFLNK */ +#include /* 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. */ -- cgit v1.2.3