~ubuntu-branches/ubuntu/precise/libpgm/precise

« back to all changes in this revision

Viewing changes to openpgm/pgm/indextoname.c.c89.patch

  • Committer: Bazaar Package Importer
  • Author(s): Gabriel de Perthuis
  • Date: 2011-04-07 16:48:52 UTC
  • Revision ID: james.westby@ubuntu.com-20110407164852-8uamem42ojeptj6l
Tags: upstream-5.1.116~dfsg
ImportĀ upstreamĀ versionĀ 5.1.116~dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--- indextoname.c       2011-03-12 10:12:42.000000000 +0800
 
2
+++ indextoname.c89.c   2011-03-12 10:40:35.000000000 +0800
 
3
@@ -40,12 +40,20 @@
 
4
 #else
 
5
        pgm_return_val_if_fail (NULL != ifname, NULL);
 
6
 
 
7
-       MIB_IFROW ifRow = { .dwIndex = ifindex };
 
8
+       {
 
9
+       MIB_IFROW ifRow;
 
10
+       ifRow.dwIndex = ifindex;
 
11
+       {
 
12
        const DWORD dwRetval = GetIfEntry (&ifRow);
 
13
        if (NO_ERROR != dwRetval)
 
14
                return NULL;
 
15
-       strcpy (ifname, (char*)ifRow.wszName);
 
16
+       {
 
17
+       size_t i;
 
18
+       pgm_wcstombs_s (&i, ifname, IF_NAMESIZE, ifRow.wszName, _TRUNCATE);
 
19
+       }
 
20
        return ifname;
 
21
+       }
 
22
+       }
 
23
 #endif /* _WIN32 */
 
24
 }
 
25