aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCristian Greco <[email protected]>2011-02-25 23:51:16 +0100
committerCristian Greco <[email protected]>2011-02-25 23:51:16 +0100
commit6228f215f1a99ab282688516d3d577295fa8ef5a (patch)
treea0a263fc16e05c4051082a871397feda5e687edc
parent49d0e593698955e96fb6cf82473bd88cb2103bb4 (diff)
downloadotp-6228f215f1a99ab282688516d3d577295fa8ef5a.tar.gz
otp-6228f215f1a99ab282688516d3d577295fa8ef5a.tar.bz2
otp-6228f215f1a99ab282688516d3d577295fa8ef5a.zip
Fix using sizeof() for array given as function argument
When using the sizeof() operator for an array given as function argument it returns the size of the pointer. In this case, the affected function hex(char digest[16], char buff[33]) will just print 4 or 8 byte instead of the full length of 16 bytes, on 32bit and 64bit systems respectively.
-rw-r--r--lib/erl_interface/src/connect/ei_connect.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_connect.c b/lib/erl_interface/src/connect/ei_connect.c
index 6dc6ebb348..c24294fbd0 100644
--- a/lib/erl_interface/src/connect/ei_connect.c
+++ b/lib/erl_interface/src/connect/ei_connect.c
@@ -1197,7 +1197,7 @@ static char *hex(char digest[16], char buff[33])
char *p = buff;
int i;
- for (i = 0; i < sizeof(digest); ++i) {
+ for (i = 0; i < 16; ++i) {
*p++ = tab[(int)((*d) >> 4)];
*p++ = tab[(int)((*d++) & 0xF)];
}