$OpenBSD: patch-libdv_dv_c,v 1.2 2004/10/13 01:44:20 jolan Exp $
--- libdv/dv.c.orig	Tue Jul  6 17:44:22 2004
+++ libdv/dv.c	Mon Oct  4 19:33:31 2004
@@ -67,8 +67,12 @@
 #define DV_MB420_YUV_MMX(a,b,c,d,e) dv_mb420_YUY2_mmx(a,b,c,d,e)
 #endif 
 
+#ifndef MIN
 #define MIN(a,b) ((a)<(b)?(a):(b))
+#endif
+#ifndef MAX
 #define MAX(a,b) ((a)<(b)?(b):(a))
+#endif
 
 int dv_use_mmx;
 
@@ -791,7 +795,7 @@ dv_get_timestamp (dv_decoder_t *dv, char
     int  id;
 
   if ((id = dv -> ssyb_pack [0x13]) != 0xff) {
-    sprintf (tstptr,
+    snprintf (tstptr, 128,
              "%02d:%02d:%02d.%02d",
              ((dv -> ssyb_data [id] [3] >> 4) & 0x03) * 10 +
               (dv -> ssyb_data [id] [3] & 0x0f),
@@ -846,7 +850,7 @@ dv_get_recording_datetime (dv_decoder_t 
     year = dv -> ssyb_data [id1] [3];
     year = (year & 0x0f) + 10 * ((year >> 4) & 0x0f);
     year += (year < 25) ? 2000 : 1900;
-    sprintf (dtptr,
+    snprintf (dtptr, 128,
              "%04d-%02d-%02d %02d:%02d:%02d",
              year,
              ((dv -> ssyb_data [id1] [2] >> 4) & 0x01) * 10 +
@@ -868,7 +872,7 @@ dv_get_recording_datetime (dv_decoder_t 
     year = dv -> vaux_data [id1] [3];
     year = (year & 0x0f) + 10 * ((year >> 4) & 0x0f);
     year += (year < 25) ? 2000 : 1900;
-    sprintf (dtptr,
+    snprintf (dtptr, 128,
              "%04d-%02d-%02d %02d:%02d:%02d",
              year,
              ((dv -> vaux_data [id1] [2] >> 4) & 0x01) * 10 +
