This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 086d8db  canutils/candump/candump.c: Fix scanf format warnings
086d8db is described below

commit 086d8db2049fd717f67a91c5250150dd3e802bcb
Author: YAMAMOTO Takashi <yamam...@midokura.com>
AuthorDate: Wed Nov 18 09:26:36 2020 +0900

    canutils/candump/candump.c: Fix scanf format warnings
---
 canutils/candump/candump.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/canutils/candump/candump.c b/canutils/candump/candump.c
index 3538d47..4bfa107 100644
--- a/canutils/candump/candump.c
+++ b/canutils/candump/candump.c
@@ -457,14 +457,14 @@ int main(int argc, char **argv)
                                ptr = nptr+1; /* hop behind the ',' */
                                nptr = strchr(ptr, ','); /* update exit 
condition */
 
-                               if (sscanf(ptr, "%x:%x",
+                               if (sscanf(ptr, "%" SCNx32 ":%" SCNx32,
                                           &rfilter[numfilter].can_id, 
                                           &rfilter[numfilter].can_mask) == 2) {
                                        rfilter[numfilter].can_mask &= 
~CAN_ERR_FLAG;
                                        if (*(ptr+8) == ':')
                                                rfilter[numfilter].can_id |= 
CAN_EFF_FLAG;
                                        numfilter++;
-                               } else if (sscanf(ptr, "%x~%x",
+                               } else if (sscanf(ptr, "%" SCNx32 "~%" SCNx32,
                                                  &rfilter[numfilter].can_id, 
                                                  &rfilter[numfilter].can_mask) 
== 2) {
                                        rfilter[numfilter].can_id |= 
CAN_INV_FILTER;
@@ -474,7 +474,7 @@ int main(int argc, char **argv)
                                        numfilter++;
                                } else if (*ptr == 'j' || *ptr == 'J') {
                                        join_filter = 1;
-                               } else if (sscanf(ptr, "#%x", &err_mask) != 1) 
{ 
+                               } else if (sscanf(ptr, "#%" SCNx32, &err_mask) 
!= 1) {
                                        fprintf(stderr, "Error in filter option 
parsing: '%s'\n", ptr);
                                        return 1;
                                }

Reply via email to