summaryrefslogtreecommitdiff
path: root/sftp-int.c
diff options
context:
space:
mode:
authordtucker <dtucker>2003-08-26 02:12:56 +0000
committerdtucker <dtucker>2003-08-26 02:12:56 +0000
commit5365eb213818b5d4cef36174c56be011939e2a4a (patch)
tree1f8a38e9b0237995d18a958787a2c7caf6a575d6 /sftp-int.c
parent1e280d5b335eb96bfa98fdda540c87651107ee74 (diff)
downloadopenssh-5365eb213818b5d4cef36174c56be011939e2a4a.tar.gz
- fgsch@cvs.openbsd.org 2003/08/25 08:13:09
[sftp-int.c] fix div by zero when listing for filename lengths longer than width. markus@ ok.
Diffstat (limited to 'sftp-int.c')
-rw-r--r--sftp-int.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sftp-int.c b/sftp-int.c
index 73653b7e..94299aa4 100644
--- a/sftp-int.c
+++ b/sftp-int.c
@@ -25,7 +25,7 @@
/* XXX: recursive operations */
#include "includes.h"
-RCSID("$OpenBSD: sftp-int.c,v 1.61 2003/07/19 00:45:53 djm Exp $");
+RCSID("$OpenBSD: sftp-int.c,v 1.62 2003/08/25 08:13:09 fgsch Exp $");
#include "buffer.h"
#include "xmalloc.h"
@@ -600,6 +600,7 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
width = ws.ws_col;
columns = width / (m + 2);
+ columns = MAX(columns, 1);
colspace = width / columns;
}
@@ -686,6 +687,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
width = ws.ws_col;
columns = width / (m + 2);
+ columns = MAX(columns, 1);
colspace = width / columns;
}