diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-16 13:01:44 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2021-10-16 13:01:44 +0100 |
commit | d46bfc3a075bb39fd5cd48b49fd43bbd3aa761f4 (patch) | |
tree | 6b377346891aa4e3fc780d628225ec00ef1ca4fe /src/lua/lua_text.c | |
parent | 83576f16712adb624fdccd370861a9db8e1fa266 (diff) | |
download | rspamd-d46bfc3a075bb39fd5cd48b49fd43bbd3aa761f4.tar.gz rspamd-d46bfc3a075bb39fd5cd48b49fd43bbd3aa761f4.zip |
[Minor] Fix some issues
Found by: coverity scan
Diffstat (limited to 'src/lua/lua_text.c')
-rw-r--r-- | src/lua/lua_text.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/lua/lua_text.c b/src/lua/lua_text.c index afda7d941..d1fd87ded 100644 --- a/src/lua/lua_text.c +++ b/src/lua/lua_text.c @@ -1398,7 +1398,7 @@ lua_text_find (lua_State *L) } #define BITOP(a,b,op) \ - ((a)[(gsize)(b)/(8*sizeof *(a))] op (gsize)1<<((gsize)(b)%(8*sizeof *(a)))) + ((a)[(guint64)(b)/(8u*sizeof *(a))] op (guint64)1<<((guint64)(b)%(8u*sizeof *(a)))) static gint lua_text_exclude_chars (lua_State *L) @@ -1408,7 +1408,7 @@ lua_text_exclude_chars (lua_State *L) gssize patlen; const gchar *pat = lua_tolstring (L, 2, &patlen), *p, *end; gchar *dest, *d; - gsize byteset[32 / sizeof(gsize)]; /* Bitset for ascii */ + guint64 byteset[32 / sizeof(guint64)]; /* Bitset for ascii */ gboolean copy = TRUE; guint *plen; @@ -1449,7 +1449,7 @@ lua_text_exclude_chars (lua_State *L) if (patlen > 0) { /* - * This stuff assumes little endian, but GSIZE_FROM_LE should + * This stuff assumes little endian, but GUINT64_FROM_LE should * deal with proper conversion */ switch (*pat) { @@ -1458,22 +1458,22 @@ lua_text_exclude_chars (lua_State *L) break; case 's': /* "\r\n\t\f " */ - byteset[0] |= GSIZE_FROM_LE (0x100003600); + byteset[0] |= GUINT64_FROM_LE(0x100003600LLU); break; case 'n': /* newlines: "\r\n" */ - byteset[0] |= GSIZE_FROM_LE (0x2400); + byteset[0] |= GUINT64_FROM_LE (0x2400LLU); break; case '8': /* 8 bit characters */ - byteset[2] |= GSIZE_FROM_LE (0xffffffffffffffffLLU); - byteset[3] |= GSIZE_FROM_LE (0xffffffffffffffffLLU); + byteset[2] |= GUINT64_FROM_LE (0xffffffffffffffffLLU); + byteset[3] |= GUINT64_FROM_LE (0xffffffffffffffffLLU); break; case 'c': /* Non printable (control) characters */ - byteset[0] |= GSIZE_FROM_LE (0xffffffff); + byteset[0] |= GUINT64_FROM_LE (0xffffffffLLU); /* Del character */ - byteset[1] |= GSIZE_FROM_LE (0x8000000000000000); + byteset[1] |= GUINT64_FROM_LE (0x8000000000000000LLU); break; } } |