diff --git a/2006/birken/README.md b/2006/birken/README.md index b246c5fc9..a1a2d85ef 100644 --- a/2006/birken/README.md +++ b/2006/birken/README.md @@ -18,6 +18,10 @@ make ./birken < file.tofu ``` +[Cody Boone Ferguson](/winners.html#Cody_Boone_Ferguson) fixed a segfault in +macOS with this entry. The problem was a missing `+1` for strlen() with +malloc(). Thank you Cody for your assistance! + ### Try: ```sh diff --git a/2006/birken/birken.c b/2006/birken/birken.c index eb5398792..638705d15 100644 --- a/2006/birken/birken.c +++ b/2006/birken/birken.c @@ -64,7 +64,7 @@ _=z->o; c=_->o->_; a= c->_->_->o; c=_ ->c++; h(c); } Q Z(a->cc){ a ->c++; h(a); } z=z->_; } } X* v(X*_,int O){ X*s=(X*)m\ -alloc(strlen(_)*siz\ +alloc(1+strlen(_)*siz\ eof(X)); X*l=s; J((*l++=*_? *_-O:0)