$OpenBSD: patch-libgfortran_io_open_c,v 1.2 2006/01/09 15:31:47 espie Exp $
--- libgfortran/io/open.c.orig	Fri Nov 18 13:40:42 2005
+++ libgfortran/io/open.c	Mon Jan  9 13:36:29 2006
@@ -317,7 +317,7 @@ new_unit (unit_flags * flags)
 	break;
 
       ioparm.file = tmpname;
-      ioparm.file_len = sprintf(ioparm.file, "fort.%d", ioparm.unit);
+      ioparm.file_len = snprintf(ioparm.file, sizeof tmpname, "fort.%d", ioparm.unit);
       break;
 
     default:
