瀏覽代碼

qemu-io: Fix if scoping bug

Fix a bug caused by lack of braces in if statement

Lack of braces means that if(count & 0x1ff) is never reached

Signed-off-by: Devin Nakamura <devin122@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Devin Nakamura 14 年之前
父節點
當前提交
5afc8b3de9
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      qemu-io.c

+ 2 - 1
qemu-io.c

@@ -449,7 +449,7 @@ static int read_f(int argc, char **argv)
         return 0;
         return 0;
     }
     }
 
 
-    if (!pflag)
+    if (!pflag) {
         if (offset & 0x1ff) {
         if (offset & 0x1ff) {
             printf("offset %" PRId64 " is not sector aligned\n",
             printf("offset %" PRId64 " is not sector aligned\n",
                    offset);
                    offset);
@@ -460,6 +460,7 @@ static int read_f(int argc, char **argv)
                    count);
                    count);
             return 0;
             return 0;
         }
         }
+    }
 
 
     buf = qemu_io_alloc(count, 0xab);
     buf = qemu_io_alloc(count, 0xab);