mirror of
https://github.com/linux-can/can-utils.git
synced 2026-09-20 23:12:09 +02:00
lib: make sprint_canframe the buffer size aware snprintf_canframe
Make sure the library functions to convert CAN frames into ASCII represenation do not exceed the given buffer size. This also applies to the long CAN frame output library function. Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
@@ -178,7 +178,7 @@ int parse_canframe(char *cs, cu_t *cu);
|
||||
* - CAN FD frames do not have a RTR bit
|
||||
*/
|
||||
|
||||
int sprint_canframe(char *buf , cu_t *cu, int sep);
|
||||
int snprintf_canframe(char *buf, size_t size, cu_t *cu, int sep);
|
||||
/*
|
||||
* Creates a CAN frame hexadecimal output in compact format.
|
||||
* The CAN data[] is separated by '.' when sep != 0.
|
||||
@@ -211,7 +211,7 @@ int sprint_canframe(char *buf , cu_t *cu, int sep);
|
||||
|
||||
#define SWAP_DELIMITER '`'
|
||||
|
||||
int sprint_long_canframe(char *buf , cu_t *cu, int view);
|
||||
int snprintf_long_canframe(char *buf, size_t size, cu_t *cu, int view);
|
||||
/*
|
||||
* Creates a CAN frame hexadecimal output in user readable format.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user