summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOran Agra <oran@redislabs.com>2020-02-06 09:33:20 +0200
committerantirez <antirez@gmail.com>2020-03-05 16:29:12 +0100
commit0c1273c3896c85beed8d84e03f4dc2300975c1f2 (patch)
tree41cb3636cc1edcdef88d6aac1932ab48ded47c6f
parent708a4e8a9bdd9de1cb9ebd3f7f10baffd3419b9e (diff)
downloadredis-0c1273c3896c85beed8d84e03f4dc2300975c1f2.tar.gz
Fix client flags to be int64 in module.c
currently there's no bug since the flags these functions handle are always lower than 32bit, but still better fix the type to prevent future bugs.
-rw-r--r--src/module.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/module.c b/src/module.c
index 46c0176f1..797f2d86d 100644
--- a/src/module.c
+++ b/src/module.c
@@ -647,9 +647,9 @@ void RM_KeyAtPos(RedisModuleCtx *ctx, int pos) {
* flags into the command flags used by the Redis core.
*
* It returns the set of flags, or -1 if unknown flags are found. */
-int commandFlagsFromString(char *s) {
+int64_t commandFlagsFromString(char *s) {
int count, j;
- int flags = 0;
+ int64_t flags = 0;
sds *tokens = sdssplitlen(s,strlen(s)," ",1,&count);
for (j = 0; j < count; j++) {
char *t = tokens[j];
@@ -727,7 +727,7 @@ int commandFlagsFromString(char *s) {
* other reason.
*/
int RM_CreateCommand(RedisModuleCtx *ctx, const char *name, RedisModuleCmdFunc cmdfunc, const char *strflags, int firstkey, int lastkey, int keystep) {
- int flags = strflags ? commandFlagsFromString((char*)strflags) : 0;
+ int64_t flags = strflags ? commandFlagsFromString((char*)strflags) : 0;
if (flags == -1) return REDISMODULE_ERR;
if ((flags & CMD_MODULE_NO_CLUSTER) && server.cluster_enabled)
return REDISMODULE_ERR;