projects
/
profile
/
ivi
/
can-utils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ddbe7d9
)
Fix commandline parameter handling for fixed canframe.data[] .
author
Oliver Hartkopp
<socketcan@hartkopp.net>
Fri, 20 Jun 2008 09:16:06 +0000
(09:16 +0000)
committer
Oliver Hartkopp
<socketcan@hartkopp.net>
Fri, 20 Jun 2008 09:16:06 +0000
(09:16 +0000)
cangen.c
patch
|
blob
|
history
diff --git
a/cangen.c
b/cangen.c
index
907811a
..
fd9e9a5
100644
(file)
--- a/
cangen.c
+++ b/
cangen.c
@@
-194,9
+194,10
@@
int main(int argc, char **argv)
data_mode = MODE_INCREMENT;
} else {
data_mode = MODE_FIX;
- incdata = strtoull(optarg, NULL, 16);
- for (i=0; i<8 ;i++)
- frame.data[i] = (incdata >> (7-i)*8) & 0xFFULL;
+ if (hexstring2candata(optarg, &frame)) {
+ printf ("wrong fix data definition\n");
+ return 1;
+ }
}
break;
@@
-225,7
+226,6
@@
int main(int argc, char **argv)
ts.tv_sec = gap / 1000;
ts.tv_nsec = (gap % 1000) * 1000000;
-
if (id_mode == MODE_FIX) {
/* recognize obviously missing commandline option */