Skip to contentSkip to conversation

multiboot: Quote filename in error message.

PATCH In review Adam Lackorzynski 2 participants 3 messages Apr 7, 2011 – Apr 8, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 multiboot: Quote filename in error message.

Quote filename in error message to spot possible whitespace character in the filename.

---
 hw/multiboot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
hw/multiboot.c +1 -1
index 0d2bfb4..6be6fa0 100644
@@ -272,7 +272,7 @@ int load_multiboot(void *fw_cfg,
             mb_debug("multiboot loading module: %s\n", initrd_filename);
             mb_mod_length = get_image_size(initrd_filename);
             if (mb_mod_length < 0) {
-                fprintf(stderr, "failed to get %s image size\n", initrd_filename);
+                fprintf(stderr, "failed to get image size of '%s'\n", initrd_filename);
                 exit(1);
             }
 
Signature · 1 line
1.7.4.1
#1 lore raw
Quoted 13 lines · Adam Lackorzynski

Quote filename in error message to spot possible whitespace character in the filename.

---
hw/multiboot.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
hw/multiboot.c +0 -0
index 0d2bfb4..6be6fa0 100644

hw/multiboot.c int load_multiboot(void *fw_cfg, · line 275

Quoted 5 lines
hw/multiboot.c +1 -1
@@ -272,7 +272,7 @@ int load_multiboot(void *fw_cfg,
            mb_debug("multiboot loading module: %s\n", initrd_filename);
            mb_mod_length = get_image_size(initrd_filename);
            if (mb_mod_length < 0) {
-                fprintf(stderr, "failed to get %s image size\n", initrd_filename);
+                fprintf(stderr, "failed to get image size of '%s'\n", initrd_filename);

I'd like to see something telling the user that the most likely reason is that the file isn't there :). It might even make sense to only say "Failed to open file '%s'".

Alex

#2 lore raw
Quoted 11 lines · Alexander Graf
Quoted 8 lines · Adam Lackorzynski

Quote filename in error message to spot possible whitespace character in the filename.

---
hw/multiboot.c | 2 +-

1 files changed, 1 insertions(+), 1 deletions(-)
Quoted 12 lines

hw/multiboot.c int load_multiboot(void *fw_cfg, · line 275

Quoted 10 lines
hw/multiboot.c +1 -1
index 0d2bfb4..6be6fa0 100644
@@ -272,7 +272,7 @@ int load_multiboot(void *fw_cfg,
            mb_debug("multiboot loading module: %s\n", initrd_filename);
            mb_mod_length = get_image_size(initrd_filename);
            if (mb_mod_length < 0) {
-                fprintf(stderr, "failed to get %s image size\n", initrd_filename);
+                fprintf(stderr, "failed to get image size of '%s'\n", initrd_filename);

I'd like to see something telling the user that the most likely reason is that the file isn't there :). It might even make sense to only say "Failed to open file '%s'".

Looking at get_image_size() it's the right thing to do...

Adam

Signature · 2 lines
Adam                 [email protected]
  Lackorzynski         http://os.inf.tu-dresden.de/~adam/