Bad format string in erts/emulator/sys/common/erl_check_io.c

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Bad format string in erts/emulator/sys/common/erl_check_io.c

Matthew Dempsky-3
In large_fd_error_common, erts_dsprintf is called with two %d
directives but only one integer argument.

--- erl_check_io.c.orig 2008-02-19 23:50:30.000000000 -0800
+++ erl_check_io.c 2008-02-19 23:51:24.000000000 -0800
@@ -741,11 +741,11 @@

 #ifdef ERTS_SYS_CONTINOUS_FD_NUMBERS
 static void
-large_fd_error_common(erts_dsprintf_buf_t *dsbufp)
+large_fd_error_common(erts_dsprintf_buf_t *dsbufp, ErtsSysFdType fd)
 {
     erts_dsprintf(dsbufp,
   "fd=%d is larger than the largest allowed fd=%d\n",
-  max_fds - 1);
+  (int) fd, max_fds - 1);
 }

 static void
@@ -754,7 +754,7 @@
     erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
     print_select_op(dsbufp, ix, fd, mode, on);
     erts_dsprintf(dsbufp, "failed: ");
-    large_fd_error_common(dsbufp);
+    large_fd_error_common(dsbufp, fd);
     erts_send_error_to_logger_nogl(dsbufp);
 }
 #endif
@@ -796,7 +796,7 @@
     erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
     print_event_op(dsbufp, ix, fd, event_data);
     erts_dsprintf(dsbufp, "failed: ");
-    large_fd_error_common(dsbufp);
+    large_fd_error_common(dsbufp, fd);
     erts_send_error_to_logger_nogl(dsbufp);
 }
 #endif


Reply | Threaded
Open this post in threaded view
|

Bad format string in erts/emulator/sys/common/erl_check_io.c

Rickard Green-4
Thanks for the patch! It will be included in R12B-2.

BR,
Rickard Green, Erlang/OTP, Ericsson AB.

Matthew Dempsky wrote:

> In large_fd_error_common, erts_dsprintf is called with two %d
> directives but only one integer argument.
>
> --- erl_check_io.c.orig 2008-02-19 23:50:30.000000000 -0800
> +++ erl_check_io.c 2008-02-19 23:51:24.000000000 -0800
> @@ -741,11 +741,11 @@
>
>  #ifdef ERTS_SYS_CONTINOUS_FD_NUMBERS
>  static void
> -large_fd_error_common(erts_dsprintf_buf_t *dsbufp)
> +large_fd_error_common(erts_dsprintf_buf_t *dsbufp, ErtsSysFdType fd)
>  {
>      erts_dsprintf(dsbufp,
>    "fd=%d is larger than the largest allowed fd=%d\n",
> -  max_fds - 1);
> +  (int) fd, max_fds - 1);
>  }
>
>  static void
> @@ -754,7 +754,7 @@
>      erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
>      print_select_op(dsbufp, ix, fd, mode, on);
>      erts_dsprintf(dsbufp, "failed: ");
> -    large_fd_error_common(dsbufp);
> +    large_fd_error_common(dsbufp, fd);
>      erts_send_error_to_logger_nogl(dsbufp);
>  }
>  #endif
> @@ -796,7 +796,7 @@
>      erts_dsprintf_buf_t *dsbufp = erts_create_logger_dsbuf();
>      print_event_op(dsbufp, ix, fd, event_data);
>      erts_dsprintf(dsbufp, "failed: ");
> -    large_fd_error_common(dsbufp);
> +    large_fd_error_common(dsbufp, fd);
>      erts_send_error_to_logger_nogl(dsbufp);
>  }
>  #endif
> _______________________________________________
> erlang-patches mailing list
> erlang-patches
> http://www.erlang.org/mailman/listinfo/erlang-patches
>