-fix crash observed on FreeBSD
[oweals/gnunet.git] / src / conversation / test_conversation_api.c
index 04700ef54a22c3c47a9382125c26f3c5d0e2fe9a..9714d5a81bce2b3cc471da42f3b888640a9f3f5e 100644 (file)
@@ -131,14 +131,14 @@ play (void *cls,
       const void *data)
 {
   const char *origin = cls;
-  static unsigned int phone_i;
+  static unsigned int phone_i = 1;
   static unsigned int call_i;
   char buf[32];
 
   if (0 == strcmp (origin, "phone"))
-    GNUNET_snprintf (buf, sizeof (buf), "phone-%u", phone_i++);
-  else
     GNUNET_snprintf (buf, sizeof (buf), "call-%u", call_i++);
+  else
+    GNUNET_snprintf (buf, sizeof (buf), "phone-%u", phone_i++);
   if ( (data_size != strlen (buf) + 1) ||
        (0 != strncmp (buf, data, data_size)) )
   {
@@ -148,6 +148,10 @@ play (void *cls,
              (int) data_size,
              (const char *) data);
   }
+  else
+  {
+    fprintf (stderr, ".");
+  }
   if ( (20 < call_i) &&
        (20 < phone_i) &&
        (NULL != call) )
@@ -381,6 +385,7 @@ call_event_handler (void *cls,
     break;
   case GNUNET_CONVERSATION_EC_CALL_SUSPENDED:
   case GNUNET_CONVERSATION_EC_CALL_RESUMED:
+  case GNUNET_CONVERSATION_EC_CALL_ERROR:
     fprintf (stderr, "Unexpected call code: %d\n", code);
     break;
   }