Procházet zdrojové kódy

Fixed getopt passing the wrong argument to stdio functions

Tom Almeida před 7 roky
rodič
revize
e1b20ed368
1 změnil soubory, kde provedl 4 přidání a 4 odebrání
  1. 4 4
      src/unistd/src/getopt.rs

+ 4 - 4
src/unistd/src/getopt.rs

@@ -69,10 +69,10 @@ unsafe fn parse_arg(
 
     let print_error = |desc: &[u8]| {
         // NOTE: we don't use fprintf to get around the usage of va_list
-        stdio::fputs(*argv as _, stdio::stderr);
-        stdio::fputs(desc.as_ptr() as _, stdio::stderr);
-        stdio::fputc(*current_arg as _, stdio::stderr);
-        stdio::fputc(b'\n' as _, stdio::stderr);
+        stdio::fputs(*argv as _, &mut *stdio::stderr);
+        stdio::fputs(desc.as_ptr() as _, &mut *stdio::stderr);
+        stdio::fputc(*current_arg as _, &mut *stdio::stderr);
+        stdio::fputc(b'\n' as _, &mut *stdio::stderr);
     };
 
     match find_option(*current_arg, optstring) {