From aebabc04470ab0d083c73510059aa0fcd538539e Mon Sep 17 00:00:00 2001 From: Tim Edwards Date: Mon, 8 Jan 2018 21:45:19 -0500 Subject: [PATCH] Corrected an error in writing out .mag files with property values that are longer than the formerly-fixed array size 256. This conflicted with the recent addition of holding path data in properties, where the path coordinates can be significantly longer than the fixed array size. Same change as made to magic version 8.1. --- commands/CmdCD.c | 1 + database/DBio.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/CmdCD.c b/commands/CmdCD.c index adace677..e819b1b9 100644 --- a/commands/CmdCD.c +++ b/commands/CmdCD.c @@ -3497,6 +3497,7 @@ CmdDrc(w, cmd) case DRC_OFF: DRCBackGround = DRC_SET_OFF; + DRCBreak(); #ifdef MAGIC_WRAPPER if (TxInputRedirect != TX_INPUT_REDIRECTED) #endif diff --git a/database/DBio.c b/database/DBio.c index daf49cd1..082eb015 100644 --- a/database/DBio.c +++ b/database/DBio.c @@ -2455,10 +2455,12 @@ dbWritePropFunc(key, value, cdata) ClientData cdata; { FILE *f = (FILE *)cdata; - char lstring[256]; + char *lstring; + lstring = (char *)mallocMagic(10 + strlen((char *)value) + strlen(key)); sprintf(lstring, "string %s %s\n", key, (char *)value); FPRINTR(f, lstring); + freeMagic(lstring); return 0; }