c
// Define a bounds-checked assignment for maxIterations
#define ASSIGN_WITH_BOUNDS(var, value, min, max) \
    do { \
        if ((value) < (min) || (value) > (max)) { \
            // Handle error: value is out of range \
            return REDISMODULE_ERR; \
        } \
        (var) = (value); \
    } while (0)

static int CFReserve_RedisCommand(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
    // ...
    long long maxIterations;
    ASSIGN_WITH_BOUNDS(maxIterations, CF_MAX_ITERATIONS, 1, 1000);
    // ...
}
