gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r28792 - gnunet/contrib


From: gnunet
Subject: [GNUnet-SVN] r28792 - gnunet/contrib
Date: Thu, 22 Aug 2013 13:01:17 +0200

Author: LRN
Date: 2013-08-22 13:01:17 +0200 (Thu, 22 Aug 2013)
New Revision: 28792

Modified:
   gnunet/contrib/timeout_watchdog_w32.c
Log:
Fix the use of s/S field types with ANSI-compliant wprintfs

Modified: gnunet/contrib/timeout_watchdog_w32.c
===================================================================
--- gnunet/contrib/timeout_watchdog_w32.c       2013-08-22 10:12:16 UTC (rev 
28791)
+++ gnunet/contrib/timeout_watchdog_w32.c       2013-08-22 11:01:17 UTC (rev 
28792)
@@ -100,7 +100,7 @@
   if (cmdlen < 5 || wcscmp (&wargv[2][cmdlen - 4], L".exe") != 0)
   {
     non_const_filename = malloc (sizeof (wchar_t) * (cmdlen + 5));
-    _snwprintf (non_const_filename, cmdlen + 5, L"%s.exe", wargv[2]);
+    swprintf (non_const_filename, cmdlen + 5, L"%S.exe", wargv[2]);
   }
   else
   {
@@ -109,7 +109,7 @@
 
   /* Check that this is the full path. If it isn't, search. */
   if (non_const_filename[1] == L':')
-    _snwprintf (wpath, sizeof (wpath) / sizeof (wchar_t), L"%s", 
non_const_filename);
+    swprintf (wpath, sizeof (wpath) / sizeof (wchar_t), L"%S", 
non_const_filename);
   else if (!SearchPathW
            (pathbuf, non_const_filename, NULL, sizeof (wpath) / sizeof 
(wchar_t),
             wpath, NULL))
@@ -134,16 +134,16 @@
     wchar_t arg_lastchar = arg[wcslen (arg) - 1];
     if (wrote == 0)
     {
-      wrote += _snwprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%s%s\" ", 
wpath,
+      wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%S%S\" ", wpath,
           arg_lastchar == L'\\' ? L"\\" : L"");
     }
     else
     {
       if (wcschr (arg, L' ') != NULL)
-        wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%s%s\"%s", 
arg,
+        wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%S%S\"%S", 
arg,
             arg_lastchar == L'\\' ? L"\\" : L"", i == wargc ? L"" : L" ");
       else
-        wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"%s%s%s", arg,
+        wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"%S%S%S", arg,
             arg_lastchar == L'\\' ? L"\\" : L"", i == wargc ? L"" : L" ");
     }
   }
@@ -156,7 +156,7 @@
   if (!CreateProcessW (wpath, wcmd, NULL, NULL, TRUE, CREATE_SUSPENDED,
        NULL, NULL, &start, &proc))
   {
-    wprintf (L"Failed to get spawn process `%s' with arguments `%s': %lu\n", 
wpath, wcmd, GetLastError ());
+    wprintf (L"Failed to get spawn process `%S' with arguments `%S': %lu\n", 
wpath, wcmd, GetLastError ());
     exit (6);
   }
 




reply via email to

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