|
@@ -9,10 +9,10 @@
|
|
|
* copies of the Software, and to permit persons to whom the
|
|
* copies of the Software, and to permit persons to whom the
|
|
|
* Software is furnished to do so, subject to the following
|
|
* Software is furnished to do so, subject to the following
|
|
|
* conditions:
|
|
* conditions:
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* The above copyright notice and this permission notice shall be
|
|
* The above copyright notice and this permission notice shall be
|
|
|
* included in all copies or substantial portions of the Software.
|
|
* included in all copies or substantial portions of the Software.
|
|
|
- *
|
|
|
|
|
|
|
+ *
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
@@ -48,6 +48,9 @@
|
|
|
#include "librs232/rs232_posix.h"
|
|
#include "librs232/rs232_posix.h"
|
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
+/*Ensure destination string is zero terminated*/
|
|
|
|
|
+#define strncpyz(dest, src, size) strncpy(dest, src, size); dest[size-1]='\0'
|
|
|
|
|
+
|
|
|
#ifdef RS232_DEBUG
|
|
#ifdef RS232_DEBUG
|
|
|
const char* rs232_hex_dump(const void *data, unsigned int len);
|
|
const char* rs232_hex_dump(const void *data, unsigned int len);
|
|
|
const char* rs232_ascii_dump(const void *data, unsigned int len);
|
|
const char* rs232_ascii_dump(const void *data, unsigned int len);
|