aboutsummaryrefslogtreecommitdiff
path: root/src/cadet/cadet_common.c
diff options
context:
space:
mode:
authorBart Polot <bart@net.in.tum.de>2014-06-17 12:13:30 +0000
committerBart Polot <bart@net.in.tum.de>2014-06-17 12:13:30 +0000
commit5c3e0f9d90b3f047a4248e96024d8a72e0062739 (patch)
tree8079f8976be82d0ffc0aabf6090d05e1b1ca9d82 /src/cadet/cadet_common.c
parentcd25d6c6f132a704d8ba8f6360bcbdc9fb0ad839 (diff)
downloadgnunet-5c3e0f9d90b3f047a4248e96024d8a72e0062739.tar.gz
gnunet-5c3e0f9d90b3f047a4248e96024d8a72e0062739.zip
- Allow two GC_2s calls in one line (limited reentrant code)
Diffstat (limited to 'src/cadet/cadet_common.c')
-rw-r--r--src/cadet/cadet_common.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cadet/cadet_common.c b/src/cadet/cadet_common.c
index 42ccf189c..94ba1bdfa 100644
--- a/src/cadet/cadet_common.c
+++ b/src/cadet/cadet_common.c
@@ -103,9 +103,11 @@ GC_h2s (const struct GNUNET_CADET_Hash *id)
103const char * 103const char *
104GC_m2s (uint16_t m) 104GC_m2s (uint16_t m)
105{ 105{
106 static char buf[32]; 106 static char buf[2][32];
107 static int idx;
107 const char *t; 108 const char *t;
108 109
110 idx = (idx + 1) % 2;
109 switch (m) 111 switch (m)
110 { 112 {
111 /** 113 /**
@@ -333,11 +335,11 @@ GC_m2s (uint16_t m)
333 break; 335 break;
334 336
335 default: 337 default:
336 sprintf(buf, "%u (UNKNOWN TYPE)", m); 338 sprintf(buf[idx], "%u (UNKNOWN TYPE)", m);
337 return buf; 339 return buf[idx];
338 } 340 }
339 sprintf(buf, "{%18s}", t); 341 sprintf(buf[idx], "{%18s}", t);
340 return buf; 342 return buf[idx];
341} 343}
342#else 344#else
343const char * 345const char *