Sfoglia il codice sorgente

Fixed getopt passing the wrong argument to stdio functions

Tom Almeida 7 anni fa
parent
commit
e1b20ed368
1 ha cambiato i file con 4 aggiunte e 4 eliminazioni
  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) {