How to send a number as a number or How to rule an LED

form form at nonsanity.com
Fri Feb 4 12:23:30 EST 2011


On Fri, Feb 4, 2011 at 12:18 PM, form <form at nonsanity.com> wrote:

>
>     else
>         ++bufloc; // next read will go in the next buf char


For safety's sake...

    else
    {
        ++bufloc; // next read will go in the next buf char
        if ( bufloc > 255 )
        {
            // ERROR - buffer overflow - line too long - missing CR? (print
something...)
            memset( buf, 0, sizeof( buf ) );
            bufloc = 0;
        }
    }

Looking at that code and knowing that error would crash it... I couldn't
stand it anymore. :)

 ~ Chris Innanen
 ~ Nonsanity



More information about the use-livecode mailing list