diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index 5c7e05f9bfc4f72cce699731af4c186ef4cea33d..40b70cecc0c12f08620ec281d804c2ee092cf64d 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -8,7 +8,7 @@
  * @format.tab-size 4		(Plain Text/Source Code File Header)			*
  * @format.use-tabs true	(see http://www.synchro.net/ptsc_hdr.html)		*
  *																			*
- * Copyright 2005 Rob Swindell - http://www.synchro.net/copyright.html		*
+ * Copyright 2006 Rob Swindell - http://www.synchro.net/copyright.html		*
  *																			*
  * This library is free software; you can redistribute it and/or			*
  * modify it under the terms of the GNU Lesser General Public License		*
@@ -1668,7 +1668,8 @@ str_list_t iniReadFile(FILE* fp)
 	str_list_t	list;
 	FILE*		insert_fp=NULL;
 	
-	rewind(fp);
+	if(fp!=NULL)
+		rewind(fp);
 
 	list = strListReadFile(fp, NULL, INI_MAX_LINE_LEN);
 	if(list==NULL)