summaryrefslogtreecommitdiffstats
path: root/3rdparty/openpgm-svn-r1135/pgm/tsi.c.c89.patch
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/openpgm-svn-r1135/pgm/tsi.c.c89.patch')
-rw-r--r--3rdparty/openpgm-svn-r1135/pgm/tsi.c.c89.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/3rdparty/openpgm-svn-r1135/pgm/tsi.c.c89.patch b/3rdparty/openpgm-svn-r1135/pgm/tsi.c.c89.patch
new file mode 100644
index 0000000..ff95ba8
--- /dev/null
+++ b/3rdparty/openpgm-svn-r1135/pgm/tsi.c.c89.patch
@@ -0,0 +1,33 @@
+--- tsi.c 2010-05-21 11:32:16.000000000 +0800
++++ tsi.c89 2010-08-05 11:01:48.000000000 +0800
+@@ -46,11 +46,18 @@
+ pgm_return_val_if_fail (NULL != buf, -1);
+ pgm_return_val_if_fail (bufsize > 0, -1);
+
++ {
+ const uint8_t* gsi = (const uint8_t*)tsi;
+ const uint16_t source_port = tsi->sport;
+
++#ifdef _MSC_VER
++ return _snprintf_s (buf, bufsize, _TRUNCATE, "%i.%i.%i.%i.%i.%i.%i",
++ gsi[0], gsi[1], gsi[2], gsi[3], gsi[4], gsi[5], ntohs (source_port));
++#else
+ return snprintf (buf, bufsize, "%i.%i.%i.%i.%i.%i.%i",
+ gsi[0], gsi[1], gsi[2], gsi[3], gsi[4], gsi[5], ntohs (source_port));
++#endif
++ }
+ }
+
+ /* transform TSI to ASCII string form.
+@@ -65,9 +72,11 @@
+ {
+ pgm_return_val_if_fail (tsi != NULL, NULL);
+
++ {
+ static char buf[PGM_TSISTRLEN];
+ pgm_tsi_print_r (tsi, buf, sizeof(buf));
+ return buf;
++ }
+ }
+
+ /* create hash value of TSI for use with GLib hash tables.