]> git.ipfire.org Git - thirdparty/zstd.git/commitdiff
refactoring brackets to allow for const values
authorPaul Cruz <paulcruz74@fb.com>
Thu, 15 Jun 2017 23:27:38 +0000 (16:27 -0700)
committerPaul Cruz <paulcruz74@fb.com>
Thu, 15 Jun 2017 23:27:38 +0000 (16:27 -0700)
programs/fileio.c

index cf329ddefc2e131f94589554918c8b51f898f977..bb3f13d8e51f406f3fdbf86e82b03a35af44576c 100644 (file)
@@ -920,11 +920,13 @@ static int getFileInfo(fileInfo_t* info, const char* inFileName){
                         detectError = 1;
                         break;
                     }
-                    int const ret = fseek(srcFile, ((long)headerSize)-((long)numBytesRead), SEEK_CUR);
-                    if (ret != 0) {
-                        DISPLAY("Error: could not move to end of frame header\n");
-                        detectError = 1;
-                        break;
+                    {
+                        int const ret = fseek(srcFile, ((long)headerSize)-((long)numBytesRead), SEEK_CUR);
+                        if (ret != 0) {
+                            DISPLAY("Error: could not move to end of frame header\n");
+                            detectError = 1;
+                            break;
+                        }
                     }
                 }
 
@@ -1038,10 +1040,12 @@ static void displayInfo(const char* inFileName, fileInfo_t* info, int displayLev
 int FIO_listFile(const char* inFileName, int displayLevel){
     fileInfo_t info;
     DISPLAYOUT("File: %s\n", inFileName);
-    int const error = getFileInfo(&info, inFileName);
-    if (error == 1) {
-        DISPLAY("An error occurred with getting file info\n");
-        return 1;
+    {
+        int const error = getFileInfo(&info, inFileName);
+        if (error == 1) {
+            DISPLAY("An error occurred with getting file info\n");
+            return 1;
+        }
     }
     displayInfo(inFileName, &info, displayLevel);
     return 0;