Only declare a variable if it will be used.
authorPeter Pentchev <roam@ringlet.net>
Sun, 22 Aug 2021 11:51:49 +0000 (14:51 +0300)
committerPeter Pentchev <roam@ringlet.net>
Sun, 22 Aug 2021 11:52:41 +0000 (14:52 +0300)
Spotted by: cppcheck

src/lib/comp/zstd/zstd.c

index 628edc75b83df41ceb4868068829b5202ff6d678..921426fcfc489a61806e279590e8cbfa31c2a412 100644 (file)
@@ -37,7 +37,9 @@ static bool init(zckCtx *zck, zckComp *comp) {
     VALIDATE_BOOL(zck);
     ALLOCD_BOOL(zck, comp);
 
+#ifndef OLD_ZSTD
     size_t retval = 0;
+#endif
 
     comp->cctx = ZSTD_createCCtx();
 #ifndef OLD_ZSTD