diff --git a/src/xpdev/ini_file.c b/src/xpdev/ini_file.c
index 5cb02e25242de535f9b79b07f23dc5ee21c3297b..6d86c1079c22c34fdfa2fcee2ec35fe9b28e6edf 100644
--- a/src/xpdev/ini_file.c
+++ b/src/xpdev/ini_file.c
@@ -370,7 +370,7 @@ char* iniSetIpAddress(str_list_t* list, const char* section, const char* key, ul
 					,ini_style_t* style)
 {
 	struct in_addr in_addr;
-	in_addr.s_addr=value;
+	in_addr.s_addr=htonl(value);
 	return iniSetString(list, section, key, inet_ntoa(in_addr), style);
 }
 #endif