wrbuf_destroy allows NULL WRBUF passed to it
[yaz-moved-to-github.git] / test / tstwrbuf.c
index 52e2fbf..af06e40 100644 (file)
@@ -1,8 +1,6 @@
-/*
- * Copyright (C) 1995-2007, Index Data ApS
+/* This file is part of the YAZ toolkit.
+ * Copyright (C) 1995-2010 Index Data
  * See the file LICENSE for details.
- *
- * $Id: tstwrbuf.c,v 1.7 2007-03-19 14:40:07 adam Exp $
  */
 
 #include <stdlib.h>
 static void tstwrbuf(void)
 {
     int step;
-    WRBUF wr = wrbuf_alloc();
+    WRBUF wr;
 
-    YAZ_CHECK(wr);
+    wr = 0;
+    wrbuf_destroy(wr);
 
+    wr = wrbuf_alloc();
+    YAZ_CHECK(wr);
     wrbuf_destroy(wr);
 
     wr = wrbuf_alloc();
@@ -63,6 +64,7 @@ int main (int argc, char **argv)
 /*
  * Local variables:
  * c-basic-offset: 4
+ * c-file-style: "Stroustrup"
  * indent-tabs-mode: nil
  * End:
  * vim: shiftwidth=4 tabstop=8 expandtab