--- a/joe/undo.c
+++ b/joe/undo.c
@@ -488,13 +488,13 @@
 void load_yank(FILE *f)
 {
 	UNDOREC *rec;
-	unsigned char buf[SMALL*4+80];
-	unsigned char bf[SMALL+1];
-	while(fgets((char *)buf,sizeof(buf)-1,f) && zcmp(buf,USTR "done\n")) {
+	unsigned char *buf = vsmk(1024);
+	unsigned char *bf = vsmk(1024);
+	while(vsgets(&buf,f) && zcmp(buf,USTR "done")) {
 		unsigned char *p = buf;
 		int len;
 		parse_ws(&p,'#');
-		len = parse_string(&p,bf,sizeof(bf));
+		len = parse_string(&p,&bf);
 		if (len>0 && len<=SMALL) {
 			if (++nyanked == MAX_YANK) {
 				frrec(deque_f(UNDOREC, link, yanked.link.next));