$OpenBSD$
--- src/boehm-gc/misc.c.orig	Mon Feb 13 18:14:20 2006
+++ src/boehm-gc/misc.c	Mon Apr 10 07:56:57 2006
@@ -660,7 +660,14 @@ void GC_init_inner()
 #   if defined(SEARCH_FOR_DATA_START)
 	GC_init_linux_data_start();
 #   endif
-#   if (defined(NETBSD) || defined(OPENBSD)) && defined(__ELF__)
+#   if defined(OPENBSD)
+#     if defined(__ELF__)
+	GC_init_openbsd_elf();
+#     else
+	GC_init_openbsd_aout();
+#     endif
+#   endif
+#   if defined(NETBSD) && defined(__ELF__)
 	GC_init_netbsd_elf();
 #   endif
 #   if defined(GC_PTHREADS) || defined(GC_SOLARIS_THREADS) \
@@ -977,7 +984,7 @@ long a, b, c, d, e, f;
     
     if (GC_quiet) return;
     buf[1024] = 0x15;
-    (void) sprintf(buf, format, a, b, c, d, e, f);
+    (void) snprintf(buf, 1025, format, a, b, c, d, e, f);
     if (buf[1024] != 0x15) ABORT("GC_printf clobbered stack");
     if (WRITE(GC_stdout, buf, strlen(buf)) < 0) ABORT("write to stdout failed");
 }
@@ -989,7 +996,7 @@ long a, b, c, d, e, f;
     char buf[1025];
     
     buf[1024] = 0x15;
-    (void) sprintf(buf, format, a, b, c, d, e, f);
+    (void) snprintf(buf, 1025, format, a, b, c, d, e, f);
     if (buf[1024] != 0x15) ABORT("GC_err_printf clobbered stack");
     if (WRITE(GC_stderr, buf, strlen(buf)) < 0) ABORT("write to stderr failed");
 }
