Index: trunk/FACT++/dim/src/diccpp.cxx
===================================================================
--- trunk/FACT++/dim/src/diccpp.cxx	(revision 11695)
+++ trunk/FACT++/dim/src/diccpp.cxx	(revision 11881)
@@ -110,12 +110,20 @@
 {
 	char *def;
+	int len = 0, new_len;
 
 	if(itsFormat)
 	{
-		return itsFormat;
+		len = strlen(itsFormat)+1;
+		if(len > 1)
+			return itsFormat;
 	}
 	def = dic_get_format(itsId);
-
-	itsFormat = new char[strlen(def)+1];
+	new_len = strlen(def)+1;
+	if(new_len > len)
+	{
+		if(itsFormat)
+			delete[] itsFormat;
+		itsFormat = new char[strlen(def)+1];
+	}
 	strcpy(itsFormat, def);
 	return itsFormat;
Index: trunk/FACT++/dim/src/dis.c
===================================================================
--- trunk/FACT++/dim/src/dis.c	(revision 11695)
+++ trunk/FACT++/dim/src/dis.c	(revision 11881)
@@ -1015,5 +1015,6 @@
 {
 	dnsp->updating_service_list = 0;
-	dis_update_service(dnsp->dis_service_id);
+	if(dnsp->dis_service_id)
+		dis_update_service(dnsp->dis_service_id);
 }
 
Index: trunk/FACT++/dim/src/examples/test_client.c
===================================================================
--- trunk/FACT++/dim/src/examples/test_client.c	(revision 11695)
+++ trunk/FACT++/dim/src/examples/test_client.c	(revision 11881)
@@ -64,5 +64,8 @@
 int *tag, *size;
 {
+	char *format;
 
+	format = dic_get_format(0);
+	printf("Received format = %s %08x, %d\n",format, format, *size);
 	if(*tag == 1100)
 	{
@@ -91,5 +94,5 @@
 	}
 	else
-		printf("%s Received %s for Service%03d\n",client_str,buf, *tag);
+		printf("%s Received %s %08X for Service%03d\n",client_str,buf, buf,*tag);
 
 /*
@@ -121,6 +124,8 @@
 	{
 		sprintf(str,"%s/Service_%03d",argv[2],i);
+//		dic_info_service( str, TIMED, 10, 0, 0, rout, i,
+//			  "No Link", 8 );
 		dic_info_service( str, TIMED, 10, 0, 0, rout, i,
-			  "No Link", 8 );
+			  NULL, 0 );
 	}
 	
Index: trunk/FACT++/dim/src/examples/test_client.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/test_client.cxx	(revision 11695)
+++ trunk/FACT++/dim/src/examples/test_client.cxx	(revision 11881)
@@ -30,6 +30,8 @@
 		int index = 0;
 		char **services;
+		char *format;
 //		cout << "Dns Node = " << DimClient::getDnsNode() << endl;
-		cout << "Received STRVAL : " << getString() << endl;
+		format = getFormat();
+		cout << "Received STRVAL : " << getString() << "format = " << format << endl;
 		services = DimClient::getServerServices();
 		cout<< "from "<< DimClient::getServerName() << " services:" << endl;
Index: trunk/FACT++/dim/src/examples/test_server.cxx
===================================================================
--- trunk/FACT++/dim/src/examples/test_server.cxx	(revision 11695)
+++ trunk/FACT++/dim/src/examples/test_server.cxx	(revision 11881)
@@ -1,2 +1,62 @@
+//============================================================================
+// Name        : emptyDimFormat.cpp
+// Author      : Etienne Lyard etienne.lyard@unige.ch
+// Version     : 00
+// Copyright   :
+// Description : Demonstrates the occurence of an empty Dim format from the client's perspective
+//============================================================================
+/*
+#include <dic.hxx>
+#include <dis.hxx>
+#include <iostream>
+using namespace std;
+
+class EmptyServiceSubscriber : public DimInfo
+{
+    DimStampedInfo* info;
+	int noLink;
+public:
+    EmptyServiceSubscriber()
+    {
+//        info = new DimStampedInfo("TIME/EMPTY", const_cast<char*>(""), this);
+		noLink = -1;
+        info = new DimStampedInfo("TIME/EMPTY", noLink, this);
+    }
+    void infoHandler()
+    {
+        DimInfo* I = getInfo();
+		int data;
+        if (I == info)
+		{
+			data = I->getInt();
+//		cout << "EMPTY SERVICE UPDATED. " << "Format: " << I->getFormat() << endl;
+			cout << "EMPTY SERVICE UPDATED. " << data << " Format: " << I->getFormat() << endl;
+		}
+    }
+};
+
+int main(int, const char**)
+{
+    DimServer::start("TIME");
+
+    int emptyFormatVariable = 0;
+    DimService* emptyFormatService = new DimService("TIME/EMPTY", "I:1", &emptyFormatVariable, sizeof(long));
+    EmptyServiceSubscriber mySubscriber;
+    //The three lines below create (most of the time) an empty format on the client side.
+    //We must be able to deal with such cases in our framework because services can be stopped and re-spawned at any time
+    delete emptyFormatService;
+    usleep(1000000);
+    emptyFormatService = new DimService("TIME/EMPTY", "I:1", &emptyFormatVariable, sizeof(long));
+
+    while (1)
+    {
+        emptyFormatService->updateService();
+        usleep(1000000);
+    }
+
+	return 0;
+}
+*/
+
 #include <iostream>
 #include <dis.hxx>
