- (djm) Make scp work on systems without 64-bit ints
diff --git a/ChangeLog b/ChangeLog
index 62f7b11..94052a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -6,6 +6,7 @@
    - markus@cvs.openbsd.org 2001/03/18 12:07:52
      [auth-options.c]
      ignore permitopen="host:port" if AllowTcpForwarding==no
+ - (djm) Make scp work on systems without 64-bit ints
 
 20010318
  - (bal) Fixed scp type casing issue which causes "scp: protocol error: 
@@ -4605,4 +4606,4 @@
  - Wrote replacements for strlcpy and mkdtemp
  - Released 1.0pre1
 
-$Id: ChangeLog,v 1.974 2001/03/19 00:13:46 mouring Exp $
+$Id: ChangeLog,v 1.975 2001/03/19 01:45:02 djm Exp $
diff --git a/scp.c b/scp.c
index 27a5029..3dcd194 100644
--- a/scp.c
+++ b/scp.c
@@ -545,9 +545,17 @@
 				goto next;
 		}
 #define	FILEMODEMASK	(S_ISUID|S_ISGID|S_IRWXU|S_IRWXG|S_IRWXO)
+#ifdef HAVE_INT64_T
 		snprintf(buf, sizeof buf, "C%04o %lld %s\n",
 		    (u_int) (stb.st_mode & FILEMODEMASK),
 		    (long long) stb.st_size, last);
+#else
+		/* XXX: Handle integer overflow? */
+		snprintf(buf, sizeof buf, "C%04o %ld %s\n",
+		    (u_int) (stb.st_mode & FILEMODEMASK),
+		    (long) stb.st_size, last);
+#endif
+
 		if (verbose_mode) {
 			fprintf(stderr, "Sending file modes: %s", buf);
 			fflush(stderr);