aboutsummaryrefslogtreecommitdiffstats
path: root/lib/erl_interface/src/decode/decode_boolean.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2013-01-11 17:27:29 +0100
committerSverker Eriksson <[email protected]>2013-01-18 15:04:03 +0100
commitb553664f54034e8c04ae6f9cc44f16b7f516518b (patch)
tree1522c655fea9aa52476e997aa26f1512d3ecada4 /lib/erl_interface/src/decode/decode_boolean.c
parent97abb095cd2182d5c3fafd525da4943ef74dc8e5 (diff)
downloadotp-b553664f54034e8c04ae6f9cc44f16b7f516518b.tar.gz
otp-b553664f54034e8c04ae6f9cc44f16b7f516518b.tar.bz2
otp-b553664f54034e8c04ae6f9cc44f16b7f516518b.zip
erl_interface: utf8 atoms continued
Diffstat (limited to 'lib/erl_interface/src/decode/decode_boolean.c')
-rw-r--r--lib/erl_interface/src/decode/decode_boolean.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/erl_interface/src/decode/decode_boolean.c b/lib/erl_interface/src/decode/decode_boolean.c
index 0a7a06f1d4..f20690249b 100644
--- a/lib/erl_interface/src/decode/decode_boolean.c
+++ b/lib/erl_interface/src/decode/decode_boolean.c
@@ -24,12 +24,11 @@
/* c non-zero -> erlang "true" atom, otherwise "false" */
int ei_decode_boolean(const char *buf, int *index, int *p)
{
- const char *s = buf + *index;
- const char *s0 = s;
- char tbuf[MAXATOMLEN+1];
+ char tbuf[6];
int t;
- if (get_atom(&s, tbuf) < 0) return -1;
+ if (ei_decode_atom_as(buf, index, tbuf, sizeof(tbuf), ERLANG_ASCII, NULL, NULL) < 0)
+ return -1;
if (memcmp(tbuf, "true", 5) == 0)
t = 1;
@@ -39,7 +38,6 @@ int ei_decode_boolean(const char *buf, int *index, int *p)
return -1;
if (p) *p = t;
- *index += s-s0;
return 0;
}