server/modules/selva/test/redis-alloc.c
static const char *_RedisModule_StringPtrLen(struct RedisModuleString *str, size_t *len) {
    struct redisObjectAccessor *robj = (struct redisObjectAccessor *)str;

	if (!str) {
		static const char errmsg[] = "(NULL string reply referenced in module)";

		if (len) {
            *len = sizeof(errmsg) - 1;
        }

		return errmsg;
	}

	if (len) {
        *len = sdslen(robj->ptr);
    }

	return robj->ptr;
}
/*
 * Partilally copied from redis-server module.c
 */
Partilally copied from redis-server module.c
Partilally copied from redis - server module . c
static const char *_RedisModule_StringPtrLen(struct RedisModuleString *str, size_t *len) {
    struct redisObjectAccessor *robj = (struct redisObjectAccessor *)str;
	if (!str) {
		static const char errmsg[] = "(NULL string reply referenced in module)";
		if (len) {
            *len = sizeof(errmsg) - 1;
        }
		return errmsg;
	}
	if (len) {
        *len = sdslen(robj->ptr);
    }
	return robj->ptr;
}
static const char * _RedisModule_StringPtrLen ( struct RedisModuleString * str , size_t * len ) { struct redisObjectAccessor * robj = ( struct redisObjectAccessor * ) str ; if ( ! str ) { static const char errmsg [ ] = " " ; if ( len ) { * len = sizeof ( errmsg ) - 1 ; } return errmsg ; } if ( len ) { * len = sdslen ( robj -> ptr ) ; } return robj -> ptr ; }
Partilally copied from redis-server module.c
Partilally copied from redis - server module . c