diff options
author | dtucker <dtucker> | 2003-08-26 02:12:56 +0000 |
---|---|---|
committer | dtucker <dtucker> | 2003-08-26 02:12:56 +0000 |
commit | 5365eb213818b5d4cef36174c56be011939e2a4a (patch) | |
tree | 1f8a38e9b0237995d18a958787a2c7caf6a575d6 /sftp-int.c | |
parent | 1e280d5b335eb96bfa98fdda540c87651107ee74 (diff) | |
download | openssh-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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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; } |