Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • \$\begingroup\$ Nice! That's what I hoped for with the -512 bonus. \$\endgroup\$ Commented Jun 13, 2012 at 20:59
  • \$\begingroup\$ Any idea why this causes crashes on by system? All of the golfed, ungolfed and malloc modified versions stop output after about 10000 bytes and keep on allocating memory, prog > out.dat gives an instant crash with only ~700 KB memory usage. If I insert printf("\n%i\n", size); after realloc, the biggest output is 4. System: Windows 7 Prof. 64-Bit, 4 GB RAM, GCC 4.6.1 \$\endgroup\$ Commented Jun 13, 2012 at 21:02
  • \$\begingroup\$ (+1) I find that with Ubuntu12.04/gcc, both of your programs compile and produce the correct output ... With Win7/mingw/gcc, both programs compile but produce segmentation faults ... With Win7/lcc, the ungolfed version works, but the golfed version produces segmentation faults. \$\endgroup\$ Commented Jun 13, 2012 at 23:09
  • 1
    \$\begingroup\$ That sounds like use of uninitialized data to me. Sure enough -- I don't have access to a Windows machine, but valgrind shows the problem. Looks like I reproduced this bug from the original reference implementation, too. Fortunately it's an easy fix; thanks for reporting it! \$\endgroup\$ Commented Jun 14, 2012 at 4:47
  • \$\begingroup\$ Great, works like a charm now. \$\endgroup\$ Commented Jun 14, 2012 at 8:59