print.c.patch   [plain text]


diff -up -r tnftpd-20091122/ls/print.c tnftpd/ls/print.c
--- tnftpd-20091122/ls/print.c	2007-07-23 04:42:17.000000000 -0700
+++ tnftpd/ls/print.c	2008-10-03 11:44:17.000000000 -0700
@@ -177,9 +177,11 @@ printcol(DISPLAY *dp)
 	if (dp->entries > lastentries) {
 		lastentries = dp->entries;
 		if ((array =
-		    realloc(array, dp->entries * sizeof(FTSENT *))) == NULL) {
+		    reallocf(array, dp->entries * sizeof(FTSENT *))) == NULL) {
 			warn(NULL);
 			printscol(dp);
+			lastentries = -1;
+			return;
 		}
 	}
 	for (p = dp->list, num = 0; p; p = p->fts_link)