X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/feae2dfc998c2e9433cb88da64cab0fdc7e5896c..fb73b28d8dd9758d692fc368fd2bb0490b5e3bcc:/pscp.c diff --git a/pscp.c b/pscp.c index 93111d39..0dbe1e34 100644 --- a/pscp.c +++ b/pscp.c @@ -765,7 +765,8 @@ void scp_sftp_listdir(char *dirname) * Now we have our filenames. Sort them by actual file * name, and then output the longname parts. */ - qsort(ournames, nnames, sizeof(*ournames), sftp_ls_compare); + if (nnames > 0) + qsort(ournames, nnames, sizeof(*ournames), sftp_ls_compare); /* * And print them.