From 1ae8714d0d4a5da885d6ab9977f2d37dae7d05f0 Mon Sep 17 00:00:00 2001 From: Heydar Elahi Date: Wed, 9 Aug 2017 11:56:05 +0430 Subject: [PATCH] Another macro usage Used same macro instead of array --- lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib.c b/lib.c index ac34fe2..dbc4513 100644 --- a/lib.c +++ b/lib.c @@ -270,7 +270,7 @@ void sprint_canframe(char *buf , struct canfd_frame *cf, int sep, int maxdlen) { buf[offset++] = 'R'; /* print a given CAN 2.0B DLC if it's not zero */ if (cf->len && cf->len <= CAN_MAX_DLC) - buf[offset++] = hex_asc_upper[cf->len & 0xF]; + buf[offset++] = hex_asc_upper_lo(cf->len); buf[offset] = 0; return; @@ -279,7 +279,7 @@ void sprint_canframe(char *buf , struct canfd_frame *cf, int sep, int maxdlen) { if (maxdlen == CANFD_MAX_DLEN) { /* add CAN FD specific escape char and flags */ buf[offset++] = '#'; - buf[offset++] = hex_asc_upper[cf->flags & 0xF]; + buf[offset++] = hex_asc_upper_lo(cf->flags); if (sep && len) buf[offset++] = '.'; }