Skip to contentSkip to conversation

objstrip: wrong variable tested after open()

PATCH New Roel Kluin 1 participant 1 message Jul 30, 2009 Alpha port

lore
Share & tools
lore

Roel Kluin

author
#0 lore raw

PATCH 1/1 objstrip: wrong variable tested after open()

The incorrect variable is tested. fd is used for another open() and is already tested.

---

arch/alpha/boot/tools/objstrip.c +1 -1
index ef18382..9d0727d 100644
@@ -93,7 +93,7 @@ main (int argc, char *argv[])
     ofd = 1;
     if (i < argc) {
 	ofd = open(argv[i++], O_WRONLY | O_CREAT | O_TRUNC, 0666);
-	if (fd == -1) {
+	if (ofd == -1) {
 	    perror("open");
 	    exit(1);
 	}