diff options
Diffstat (limited to 'sftp-client.c')
-rw-r--r-- | sftp-client.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sftp-client.c b/sftp-client.c index c34f919a4..8b4d67b58 100644 --- a/sftp-client.c +++ b/sftp-client.c | |||
@@ -393,8 +393,7 @@ do_lsreaddir(struct sftp_conn *conn, char *path, int printflag, | |||
393 | printf("%s\n", longname); | 393 | printf("%s\n", longname); |
394 | 394 | ||
395 | if (dir) { | 395 | if (dir) { |
396 | *dir = xrealloc(*dir, sizeof(**dir) * | 396 | *dir = xrealloc(*dir, ents + 2, sizeof(**dir)); |
397 | (ents + 2)); | ||
398 | (*dir)[ents] = xmalloc(sizeof(***dir)); | 397 | (*dir)[ents] = xmalloc(sizeof(***dir)); |
399 | (*dir)[ents]->filename = xstrdup(filename); | 398 | (*dir)[ents]->filename = xstrdup(filename); |
400 | (*dir)[ents]->longname = xstrdup(longname); | 399 | (*dir)[ents]->longname = xstrdup(longname); |