>-----Original Message----- >From: PerL >Sent: 15 February 2005 13:06 >To: Microcontroller discussion list - Public. >Subject: Re: [PIC] Bug in Microchip mcc18 std library? > > >Is there a reason you can't use: > > void putrsUSART(const rom char *data) >{ > do > { // Transmit a byte > while(BusyUSART()); > putcUSART(*data); > } while( *++data ); // <<<<<<<< > } > >? > >PerL Consider what would happen if the pointer were pointing to a NULL string. The NULL would be sent, and then the next character (some random memory address) would be checked. This is a very dangerous function, it could potentially send out huge amounts of garbage data. IMO the value should always be checked BEFORE sending it, not after. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist