Happy new year
[yazpp-moved-to-github.git] / src / gdu.cpp
index 10860cf..9c6f6dc 100644 (file)
@@ -1,8 +1,11 @@
 /* This file is part of the yazpp toolkit.
- * Copyright (C) 1998-2009 Index Data and Mike Taylor
+ * Copyright (C) Index Data and Mike Taylor
  * See the file LICENSE for details.
  */
 
+#if HAVE_CONFIG_H
+#include <config.h>
+#endif
 #include <yazpp/gdu.h>
 
 using namespace yazpp_1;
@@ -39,9 +42,10 @@ void GDU::base(Z_GDU *gdu, ODR encode)
     {
         int len;
         char *buf = odr_getbuf(encode, &len, 0);
-        
+
         odr_setbuf(m_decode, buf, len, 0);
-        z_GDU(m_decode, &m_gdu, 0, 0);
+        if (!z_GDU(m_decode, &m_gdu, 0, 0))
+            m_gdu = 0;
     }
     odr_destroy(encode);
 }