OSDN Git Service

* src/lha.h: correct usage of mkstemp().
[lha/lha.git] / src / lhadd.c
index 3f0981c..8b0ed40 100644 (file)
@@ -277,14 +277,13 @@ build_temporary_file()
 
     remove_temporary_at_error = TRUE;
     temporary_fd = build_temporary_name();
-    if (fd == -1)
+    if (temporary_fd == -1)
         fatal_error(temporary_name);
 
-    afp = fdopen(temporary_name, WRITE_BINARY);
+    afp = fdopen(temporary_fd, WRITE_BINARY);
     if (afp == NULL)
         fatal_error(temporary_name);
 
-
     return afp;
 }