gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r33689 - gnunet/src/cadet


From: gnunet
Subject: [GNUnet-SVN] r33689 - gnunet/src/cadet
Date: Tue, 17 Jun 2014 14:13:30 +0200

Author: bartpolot
Date: 2014-06-17 14:13:30 +0200 (Tue, 17 Jun 2014)
New Revision: 33689

Modified:
   gnunet/src/cadet/cadet_common.c
Log:
- Allow two GC_2s calls in one line (limited reentrant code)

Modified: gnunet/src/cadet/cadet_common.c
===================================================================
--- gnunet/src/cadet/cadet_common.c     2014-06-17 12:13:29 UTC (rev 33688)
+++ gnunet/src/cadet/cadet_common.c     2014-06-17 12:13:30 UTC (rev 33689)
@@ -103,9 +103,11 @@
 const char *
 GC_m2s (uint16_t m)
 {
-  static char buf[32];
+  static char buf[2][32];
+  static int idx;
   const char *t;
 
+  idx = (idx + 1) % 2;
   switch (m)
   {
       /**
@@ -333,11 +335,11 @@
       break;
 
     default:
-      sprintf(buf, "%u (UNKNOWN TYPE)", m);
-      return buf;
+      sprintf(buf[idx], "%u (UNKNOWN TYPE)", m);
+      return buf[idx];
   }
-  sprintf(buf, "{%18s}", t);
-  return buf;
+  sprintf(buf[idx], "{%18s}", t);
+  return buf[idx];
 }
 #else
 const char *




reply via email to

[Prev in Thread] Current Thread [Next in Thread]