diff options
author | Madelyn Olson <34459052+madolson@users.noreply.github.com> | 2020-08-11 20:04:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-11 20:04:54 -0700 |
commit | f2db379fa3f6e0c0d81350fd0f29febea95df469 (patch) | |
tree | 07a32accac0b537fd5cef4c3788c7595483953ad /src/bitops.c | |
parent | ddcbb628a18cbd6febc6c31e71de1a140239e8b4 (diff) | |
download | redis-f2db379fa3f6e0c0d81350fd0f29febea95df469.tar.gz |
Replace usage of wrongtypeerr with helper (#7633)
* Replace usage of wrongtypeerr with helper
Diffstat (limited to 'src/bitops.c')
-rw-r--r-- | src/bitops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/bitops.c b/src/bitops.c index 4b1a09aa4..37fb13f0c 100644 --- a/src/bitops.c +++ b/src/bitops.c @@ -480,12 +480,12 @@ int getBitfieldTypeFromArgument(client *c, robj *o, int *sign, int *bits) { robj *lookupStringForBitCommand(client *c, size_t maxbit) { size_t byte = maxbit >> 3; robj *o = lookupKeyWrite(c->db,c->argv[1]); + if (checkType(c,o,OBJ_STRING)) return NULL; if (o == NULL) { o = createObject(OBJ_STRING,sdsnewlen(NULL, byte+1)); dbAdd(c->db,c->argv[1],o); } else { - if (checkType(c,o,OBJ_STRING)) return NULL; o = dbUnshareStringValue(c->db,c->argv[1],o); o->ptr = sdsgrowzero(o->ptr,byte+1); } |