Skip to content

Commit a7ccfe2

Browse files
committed
Merge branch 'master' into aes
2 parents 197d1bc + 24139be commit a7ccfe2

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/resty/string.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ ffi.cdef[[
1111
typedef unsigned char u_char;
1212

1313
u_char * ngx_hex_dump(u_char *dst, const u_char *src, size_t len);
14+
15+
intptr_t ngx_atoi(const unsigned char *line, size_t n);
1416
]]
1517

1618
local str_type = ffi.typeof("uint8_t[?]")
@@ -24,6 +26,11 @@ function to_hex(s)
2426
end
2527

2628

29+
function atoi(s)
30+
return tonumber(C.ngx_atoi(s, #s))
31+
end
32+
33+
2734
-- to prevent use of casual module global variables
2835
getmetatable(resty.string).__newindex = function (table, key, val)
2936
error('attempt to write to undeclared variable "' .. key .. '": '

valgrind.suppress

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
{
2+
<insert_a_suppression_name_here>
3+
Memcheck:Cond
4+
fun:lj_str_new
5+
obj:*
6+
}
17
{
28
<insert_a_suppression_name_here>
39
Memcheck:Param

0 commit comments

Comments
 (0)