<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">
<div><br class="webkit-block-placeholder"></div><div>Crashes are usually because memory hasn't been allocated properly.  I'd check x-&gt;current and x-&gt;step.  Hooking up to gdb will give you a lot more info.  Search puredata.info for 'gdb' for a little howto.</div><div><br class="webkit-block-placeholder"></div><div>.hc</div><br><div><div>On Mar 16, 2008, at 7:42 PM, Greg Surges wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Hi all,<br><br>The following code crashes Pd when the randomwalk object receives a bang...<br>I'm stuck as to why, can anyone see a reason?<br>void randomwalk_bang(t_randomwalk *x)<br>{<br>    t_float randval = rand() % 2;<br>     if(randval == 0) randval = -1;<br>    if(randval == 1) randval = 1;<br>    x-&gt;current += (x-&gt;step * randval);<br>    outlet_float(x-&gt;f_out, x-&gt;current);<br>}<br clear="all"><br>Thanks in advance,<br><br>-Greg<br> <br>-- <br><a href="http://www.uwm.edu/~gssurges/">http://www.uwm.edu/~gssurges/</a><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">_______________________________________________</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">PD-dev mailing list</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="mailto:PD-dev@iem.at">PD-dev@iem.at</a></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><a href="http://lists.puredata.info/listinfo/pd-dev">http://lists.puredata.info/listinfo/pd-dev</a></div> </blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div><br></div><div>----------------------------------------------------------------------------</div><div><br></div><div>I spent 33 years and four months in active military service and during that period I spent most of my time as a high class muscle man for Big Business, for Wall Street and the bankers.      - General Smedley Butler</div><br class="Apple-interchange-newline"></span></span> </div><br></body></html>