Minor fixes and cleanups before opening

master
Dvir Volk 9 years ago
parent c3e8542aa9
commit 9425602b23

@ -20,15 +20,9 @@ else
endif
CFLAGS = -I$(RM_INCLUDE_DIR) -Wall -g -fPIC -lc -lm -Og -std=gnu99
CC=gcc
.SUFFIXES: .c .so .xo .o
all: module.so
#c.xo:
#$(CC) -I. $(CFLAGS) $(SHOBJ_CFLAGS) -fPIC -c $< -o $@
#mdma.xo: ./index.h
module.so: module.o
$(LD) -o $@ module.o $(SHOBJ_LDFLAGS) $(LIBS) -L$(RMUTIL_LIBDIR) -lrmutil -lc

@ -32,7 +32,7 @@ int ParseCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
RedisModule_ReplyWithLongLong(ctx, x * y);
return REDISMODULE_ERR;
}
// something is fishy...
RedisModule_ReplyWithError(ctx, "Invalid arguments");

@ -27,7 +27,7 @@ int RMUtil_StringEquals(RedisModuleString *s1, RedisModuleString *s2) {
c1 = RedisModule_StringPtrLen(s1, &l1);
c2 = RedisModule_StringPtrLen(s2, &l2);
return strcmp(c1, c2) == 0;
return strncmp(c1, c2, MAX(l1, l2)) == 0;
}
void RMUtil_StringToLower(RedisModuleString *s) {

@ -18,7 +18,7 @@ int RMUtil_ArgExists(const char *arg, RedisModuleString **argv, int argc, int of
for (; offset < argc; offset++) {
size_t l;
const char *carg = RedisModule_StringPtrLen(argv[offset], &l);
if (carg != NULL && strncasecmp(carg, arg, l) == 0) {
if (carg != NULL && strcasecmp(carg, arg) == 0) {
return offset;
}
}

Loading…
Cancel
Save