summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/input/libdvdnav/dvdnav_internal.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/input/libdvdnav/dvdnav_internal.h b/src/input/libdvdnav/dvdnav_internal.h
index d6e8bef5b..737ef6387 100644
--- a/src/input/libdvdnav/dvdnav_internal.h
+++ b/src/input/libdvdnav/dvdnav_internal.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dvdnav_internal.h,v 1.16 2006/09/17 13:01:08 valtri Exp $
+ * $Id: dvdnav_internal.h,v 1.17 2006/09/26 20:17:43 dgp85 Exp $
*
*/
@@ -202,6 +202,10 @@ struct dvdnav_s {
/** USEFUL MACROS **/
+/* printerr*() are often called when this is NULL. Avoid segfaults by replacing these with
+ * more common prints
+ */
+#if 0
#ifdef __GNUC__
#define printerrf(format, args...) snprintf(this->err_str, MAX_ERR_LEN, format, ## args);
#else
@@ -212,5 +216,17 @@ struct dvdnav_s {
#endif /* WIN32 */
#endif
#define printerr(str) strncpy(this->err_str, str, MAX_ERR_LEN);
+#endif
+
+#ifdef __GNUC__
+#define printerrf(format, args...) fprintf(stderr, format, ## args);
+#else
+#ifdef _MSC_VER
+#define printerrf(str) fprintf(stderr, str);
+#else
+#define printerrf(...) fprintf(stderr, __VA_ARGS__);
+#endif /* WIN32 */
+#endif
+#define printerr(str) fprintf(stderr, "%s", str);
#endif /* DVDNAV_INTERNAL_H_INCLUDED */