diff mbox

[2/2] qemu-io: Fix if scoping bug

Message ID BANLkTinvfuoOESXFiA1ndfwNadMP94xEaA@mail.gmail.com
State New
Headers show

Commit Message

Devin Nakamura June 11, 2011, 3:29 a.m. UTC
Fix a bug caused by lack of braces in if statement

Signed-off-by: Devin Nakamura <devin122@gmail.com>
---
 qemu-io.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

Comments

Markus Armbruster June 14, 2011, 8:42 a.m. UTC | #1
Devin Nakamura <devin122@gmail.com> writes:

> Fix a bug caused by lack of braces in if statement

You describe the bug's cause.  That's good.  Please also describe the
bug's effect, i.e. what exactly is broken for users.

>
> Signed-off-by: Devin Nakamura <devin122@gmail.com>
> ---
>  qemu-io.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/qemu-io.c b/qemu-io.c
> index 53adb76..1c4f684 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -433,12 +433,12 @@ static int read_f(int argc, char **argv)
>          return 0;
>      }
>
> -    if (!pflag)
> +    if (!pflag){

Put a space between ) and {

>          if (offset & 0x1ff) {
>              printf("offset %" PRId64 " is not sector aligned\n",
>                     offset);
>              return 0;
> -
> +        }
>          if (count & 0x1ff) {
>              printf("count %d is not sector aligned\n",
>                     count);
diff mbox

Patch

diff --git a/qemu-io.c b/qemu-io.c
index 53adb76..1c4f684 100644
--- a/qemu-io.c
+++ b/qemu-io.c
@@ -433,12 +433,12 @@  static int read_f(int argc, char **argv)
         return 0;
     }

-    if (!pflag)
+    if (!pflag){
         if (offset & 0x1ff) {
             printf("offset %" PRId64 " is not sector aligned\n",
                    offset);
             return 0;
-
+        }
         if (count & 0x1ff) {
             printf("count %d is not sector aligned\n",
                    count);