summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flist.c5
-rw-r--r--hlink.c14
-rw-r--r--main.c2
3 files changed, 10 insertions, 11 deletions
diff --git a/flist.c b/flist.c
index 6b51ee29..ef1d098a 100644
--- a/flist.c
+++ b/flist.c
@@ -634,10 +634,9 @@ static void clean_fname(char *name)
if (strncmp(p=name,"./",2) == 0) {
modified = 1;
- while (*p) {
+ do {
p[0] = p[2];
- p++;
- }
+ } while (*p++);
}
l = strlen(p=name);
diff --git a/hlink.c b/hlink.c
index 495c0a86..b6e6f28d 100644
--- a/hlink.c
+++ b/hlink.c
@@ -73,12 +73,12 @@ int check_hard_link(struct file_struct *file)
{
#if SUPPORT_HARD_LINKS
int low=0,high=hlink_count-1;
- int mid=0,ret=0;
+ int ret=0;
if (!hlink_list || !S_ISREG(file->mode)) return 0;
while (low != high) {
- mid = (low+high)/2;
+ int mid = (low+high)/2;
ret = hlink_compare(&hlink_list[mid],file);
if (ret == 0) break;
if (ret > 0)
@@ -87,12 +87,12 @@ int check_hard_link(struct file_struct *file)
low=mid+1;
}
- if (hlink_compare(&hlink_list[mid],file) != 0) return 0;
+ if (hlink_compare(&hlink_list[low],file) != 0) return 0;
- if (mid > 0 &&
- S_ISREG(hlink_list[mid-1].mode) &&
- file->dev == hlink_list[mid-1].dev &&
- file->inode == hlink_list[mid-1].inode)
+ if (low > 0 &&
+ S_ISREG(hlink_list[low-1].mode) &&
+ file->dev == hlink_list[low-1].dev &&
+ file->inode == hlink_list[low-1].inode)
return 1;
#endif
diff --git a/main.c b/main.c
index e4e4c563..88d28d70 100644
--- a/main.c
+++ b/main.c
@@ -166,7 +166,7 @@ static void server_options(char **args,int *argc)
-int do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int *f_out)
+static int do_cmd(char *cmd,char *machine,char *user,char *path,int *f_in,int *f_out)
{
char *args[100];
int i,argc=0, ret;