$OpenBSD: patch-libhfsp_src_record_c,v 1.1 2011/02/06 16:03:55 fgsch Exp $
--- libhfsp/src/record.c.orig	Sun Mar 17 17:20:01 2002
+++ libhfsp/src/record.c	Sat Jan 29 06:22:42 2011
@@ -32,6 +32,8 @@
 
 #include <errno.h>
 #include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
 
 #include "libhfsp.h"
 #include "hfstime.h"
@@ -508,9 +510,9 @@ static void* record_writethread(void *p, hfsp_cat_thre
 /* read a hfsp_cat_entry from memory */
 void* record_readentry(void *p, void* entry)
 {
-    UInt16	    type = bswabU16_inc(p);
+    UInt16	    type;
     hfsp_cat_entry* e	 = (hfsp_cat_entry*) entry;
-    e->type = type;
+    e->type = type = bswabU16_inc(p);
     switch (type)
     {
 	case HFSP_FOLDER:
