This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

serial library function issues

1. The manual pages for strcpy() and strcat() state they append a \0 to the desitnation string, but they do not appear to do this.

(several serial functions do not - most of those manual pages do not warn you of this so you need to pay attention but you can see in the example code that Keil adds a '\0' manually when calling them which should be clue if you look - this is not the case for the above functions howver which explicitly say they add the \0)

2. When I customize _getkey() and putchar() the library functions that call these work but I get strange results (i.e. garbage characters spewed onto terminal screen) when calling them directly from my code, forcing me to try to use puts() and gets() instead. Sometimes making putchar() use a copy of the passed char fixes this, but not always.

3. When I use gets() on a line terminated with \r\n what is supposed to happen? The manual says I should wind up with a \r\0 but it appears I am getting no \r and then the \n is not being read perhaps, except the next gets() call. Also it seems a gets() with just \n may not actually change the passed buffer.

Since they do not work as stated I would like the source for the serial functions, especially gets(), to figure out what is going on with them.

0