use constants, lint from rick@seismo
authorJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 10 Oct 1985 07:46:28 +0000 (23:46 -0800)
committerJim Bloom <bloom@ucbvax.Berkeley.EDU>
Thu, 10 Oct 1985 07:46:28 +0000 (23:46 -0800)
SCCS-vsn: usr.bin/uucp/libuu/cpmv.c 5.5

usr/src/usr.bin/uucp/libuu/cpmv.c

index 07cfe34..d7a2261 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)cpmv.c     5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)cpmv.c     5.5 (Berkeley) %G%";
 #endif
 
 #include "uucp.h"
 #endif
 
 #include "uucp.h"
@@ -10,9 +10,8 @@ static char sccsid[] = "@(#)cpmv.c    5.4 (Berkeley) %G%";
 /*
  *     copy f1 to f2
  *
 /*
  *     copy f1 to f2
  *
- *     return - 0 ok  |  FAIL failed
+ *     return - SUCCESS | FAIL
  */
  */
-
 xcp(f1, f2)
 char *f1, *f2;
 {
 xcp(f1, f2)
 char *f1, *f2;
 {
@@ -20,7 +19,7 @@ char *f1, *f2;
        register int len;
        register int fp1, fp2;
        char *lastpart();
        register int len;
        register int fp1, fp2;
        char *lastpart();
-       char full[100];
+       char full[MAXFULLNAME];
        struct stat s;
 
        if ((fp1 = open(subfile(f1), 0)) < 0)
        struct stat s;
 
        if ((fp1 = open(subfile(f1), 0)) < 0)
@@ -51,17 +50,16 @@ char *f1, *f2;
 
 
 /*
 
 
 /*
- *     xmv(f1, f2)     move f1 to f2
- *     char * f1, *f2;
+ *     move f1 to f2
  *
  *     return  0 ok  |  FAIL failed
  */
  *
  *     return  0 ok  |  FAIL failed
  */
-
 xmv(f1, f2)
 register char *f1, *f2;
 {
        register int ret;
 
 xmv(f1, f2)
 register char *f1, *f2;
 {
        register int ret;
 
+       (void) unlink(subfile(f2));
        if (link(subfile(f1), subfile(f2)) < 0) {
                /*  copy file  */
                ret = xcp(f1, f2);
        if (link(subfile(f1), subfile(f2)) < 0) {
                /*  copy file  */
                ret = xcp(f1, f2);
@@ -69,6 +67,6 @@ register char *f1, *f2;
                        unlink(subfile(f1));
                return ret;
        }
                        unlink(subfile(f1));
                return ret;
        }
-       unlink(subfile(f1));
+       (void) unlink(subfile(f1));
        return 0;
 }
        return 0;
 }