Changeset: 2cf7e418de40 for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=2cf7e418de40
Modified Files:
        buildtools/Mx/Def.c
Branch: Aug2011
Log Message:

DefBlk: avoid using strncat for Darwin9 (crashes)

Use memcpy instead of strncat.  In this case should be cheaper as well,
since we know the size already.  The limit for strncat was off by one,
since strncat adds the trailing \0 always, so could theoretically be
at size + 2.  This, however was not the problem why strncat internally
fails on its checks on Darwin 9.

With this change, a debug-compiled Mx can unpack gdk sources on Darwin 9.


diffs (12 lines):

diff --git a/buildtools/Mx/Def.c b/buildtools/Mx/Def.c
--- a/buildtools/Mx/Def.c
+++ b/buildtools/Mx/Def.c
@@ -499,7 +499,7 @@ DefBlk(void)
                }
                if (f + size + 1 > blk + M_BLK)
                        Fatal("Mx:Too long block, use extra 
directives:[%s:%d].\n", mx_file, mx_line);
-               strncat(f, line, size + 1);
+               memcpy(f, line, size + 1);
                f += size;
                line = NextLine();
        }
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to