unify buffer size for ASCII CAN frame string representations

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
This commit is contained in:
Oliver Hartkopp
2024-02-29 07:10:34 +01:00
parent 34a1cfad29
commit 1da219922d
5 changed files with 43 additions and 43 deletions
+4 -4
View File
@@ -183,7 +183,7 @@ void canfd_asc(struct canfd_frame *cf, int devno, int mtu, char *extra_info, FIL
int main(int argc, char **argv)
{
static char buf[BUFSZ], device[BUFSZ], ascframe[10000], extra_info[BUFSZ];
static char buf[BUFSZ], device[BUFSZ], afrbuf[AFRSZ], extra_info[BUFSZ];
static cu_t cu;
static struct timeval tv, start_tv;
@@ -262,13 +262,13 @@ int main(int argc, char **argv)
continue;
if (sscanf(buf, "(%llu.%llu) %s %s %s", &sec, &usec,
device, ascframe, extra_info) != 5) {
device, afrbuf, extra_info) != 5) {
/* do not evaluate the extra info */
extra_info[0] = 0;
if (sscanf(buf, "(%llu.%llu) %s %s", &sec, &usec,
device, ascframe) != 4) {
device, afrbuf) != 4) {
fprintf(stderr, "incorrect line format in logfile\n");
return 1;
}
@@ -295,7 +295,7 @@ int main(int argc, char **argv)
if (devno) { /* only convert for selected CAN devices */
mtu = parse_canframe(ascframe, &cu);
mtu = parse_canframe(afrbuf, &cu);
/* convert only CAN CC and CAN FD frames */
if ((mtu != CAN_MTU) && (mtu != CANFD_MTU))