| 1 | --- tests/test_disconnect_inproc.cpp.orig 2013-05-20 09:33:26.000000000 -0500 |
| 2 | +++ tests/test_disconnect_inproc.cpp 2013-05-20 09:33:34.000000000 -0500 |
| 3 | @@ -9,6 +9,21 @@ |
| 4 | zmq_msg_init_size (&msg, size + 1) && printf("zmq_msg_init_size: %s\n",zmq_strerror(errno)); \ |
| 5 | memcpy(zmq_msg_data(&msg), data, size + 1); |
| 6 | |
| 7 | +char *strndup(const char *s, size_t n); |
| 8 | + |
| 9 | +char *strndup(const char *s, size_t n) |
| 10 | +{ |
| 11 | + size_t m = 0; |
| 12 | + const char * p = s - 1; |
| 13 | + if (n) |
| 14 | + while (*++p && ++m < n) ; |
| 15 | + char * const x = (char *) malloc(m + 1); |
| 16 | + if (x == NULL) return NULL; |
| 17 | + memcpy(x, s, m); |
| 18 | + x[m] = 0; |
| 19 | + return x; |
| 20 | +} |
| 21 | + |
| 22 | int publicationsReceived = 0; |
| 23 | bool isSubscribed = false; |
| 24 | |