projects
/
platform
/
core
/
system
/
swap-probe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
595d084
)
[FIX] garbage in high bytes of arguments
author
Nikita Kalyazin
<n.kalyazin@samsung.com>
Thu, 25 Jul 2013 16:00:00 +0000
(20:00 +0400)
committer
Nikita Kalyazin
<n.kalyazin@samsung.com>
Thu, 25 Jul 2013 16:00:00 +0000
(20:00 +0400)
include/binproto.h
patch
|
blob
|
history
diff --git
a/include/binproto.h
b/include/binproto.h
index c2da73c9f6a8924b4860ebc01209bd170086de5e..31c4dca8123e12031f509060198475ad2f063a39 100644
(file)
--- a/
include/binproto.h
+++ b/
include/binproto.h
@@
-146,13
+146,15
@@
static inline char *pack_args(char *to, const char *fmt, ...)
to += sizeof(d);
break;
case 'x':
- x = (uint64_t)va_arg(args, uint64_t);
+ x = 0; // real value may be less then uint64_t
+ x = (unsigned long)(uint64_t)va_arg(args, uint64_t);
*to++ = *t;
memcpy(to, &x, sizeof(x));
to += sizeof(x);
break;
case 'p':
- p = (uintptr_t)va_arg(args, uint64_t);
+ p = 0; // real value may be less then uint64_t
+ p = (unsigned long)(uintptr_t)va_arg(args, uint64_t);
*to++ = *t;
memcpy(to, &p, sizeof(p));
to += sizeof(p);