diff options
author | LRN <lrn1986@gmail.com> | 2013-08-22 11:01:17 +0000 |
---|---|---|
committer | LRN <lrn1986@gmail.com> | 2013-08-22 11:01:17 +0000 |
commit | 29a2affb74266415e5cfe6d3608b047a12c14ba2 (patch) | |
tree | 30df5c5a80f1d2d1c1d716d7607924d894d5369d /contrib | |
parent | 9e92233f5d900b68ca5c6b7f4cc658175ba5536e (diff) | |
download | gnunet-29a2affb74266415e5cfe6d3608b047a12c14ba2.tar.gz gnunet-29a2affb74266415e5cfe6d3608b047a12c14ba2.zip |
Fix the use of s/S field types with ANSI-compliant wprintfs
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/timeout_watchdog_w32.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/contrib/timeout_watchdog_w32.c b/contrib/timeout_watchdog_w32.c index e136c03a8..d5117d71f 100644 --- a/contrib/timeout_watchdog_w32.c +++ b/contrib/timeout_watchdog_w32.c | |||
@@ -100,7 +100,7 @@ main (int argc, char *argv[]) | |||
100 | if (cmdlen < 5 || wcscmp (&wargv[2][cmdlen - 4], L".exe") != 0) | 100 | if (cmdlen < 5 || wcscmp (&wargv[2][cmdlen - 4], L".exe") != 0) |
101 | { | 101 | { |
102 | non_const_filename = malloc (sizeof (wchar_t) * (cmdlen + 5)); | 102 | non_const_filename = malloc (sizeof (wchar_t) * (cmdlen + 5)); |
103 | _snwprintf (non_const_filename, cmdlen + 5, L"%s.exe", wargv[2]); | 103 | swprintf (non_const_filename, cmdlen + 5, L"%S.exe", wargv[2]); |
104 | } | 104 | } |
105 | else | 105 | else |
106 | { | 106 | { |
@@ -109,7 +109,7 @@ main (int argc, char *argv[]) | |||
109 | 109 | ||
110 | /* Check that this is the full path. If it isn't, search. */ | 110 | /* Check that this is the full path. If it isn't, search. */ |
111 | if (non_const_filename[1] == L':') | 111 | if (non_const_filename[1] == L':') |
112 | _snwprintf (wpath, sizeof (wpath) / sizeof (wchar_t), L"%s", non_const_filename); | 112 | swprintf (wpath, sizeof (wpath) / sizeof (wchar_t), L"%S", non_const_filename); |
113 | else if (!SearchPathW | 113 | else if (!SearchPathW |
114 | (pathbuf, non_const_filename, NULL, sizeof (wpath) / sizeof (wchar_t), | 114 | (pathbuf, non_const_filename, NULL, sizeof (wpath) / sizeof (wchar_t), |
115 | wpath, NULL)) | 115 | wpath, NULL)) |
@@ -134,16 +134,16 @@ main (int argc, char *argv[]) | |||
134 | wchar_t arg_lastchar = arg[wcslen (arg) - 1]; | 134 | wchar_t arg_lastchar = arg[wcslen (arg) - 1]; |
135 | if (wrote == 0) | 135 | if (wrote == 0) |
136 | { | 136 | { |
137 | wrote += _snwprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%s%s\" ", wpath, | 137 | wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%S%S\" ", wpath, |
138 | arg_lastchar == L'\\' ? L"\\" : L""); | 138 | arg_lastchar == L'\\' ? L"\\" : L""); |
139 | } | 139 | } |
140 | else | 140 | else |
141 | { | 141 | { |
142 | if (wcschr (arg, L' ') != NULL) | 142 | if (wcschr (arg, L' ') != NULL) |
143 | wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%s%s\"%s", arg, | 143 | wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"\"%S%S\"%S", arg, |
144 | arg_lastchar == L'\\' ? L"\\" : L"", i == wargc ? L"" : L" "); | 144 | arg_lastchar == L'\\' ? L"\\" : L"", i == wargc ? L"" : L" "); |
145 | else | 145 | else |
146 | wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"%s%s%s", arg, | 146 | wrote += swprintf (&wcmd[wrote], cmdlen + 1 - wrote, L"%S%S%S", arg, |
147 | arg_lastchar == L'\\' ? L"\\" : L"", i == wargc ? L"" : L" "); | 147 | arg_lastchar == L'\\' ? L"\\" : L"", i == wargc ? L"" : L" "); |
148 | } | 148 | } |
149 | } | 149 | } |
@@ -156,7 +156,7 @@ main (int argc, char *argv[]) | |||
156 | if (!CreateProcessW (wpath, wcmd, NULL, NULL, TRUE, CREATE_SUSPENDED, | 156 | if (!CreateProcessW (wpath, wcmd, NULL, NULL, TRUE, CREATE_SUSPENDED, |
157 | NULL, NULL, &start, &proc)) | 157 | NULL, NULL, &start, &proc)) |
158 | { | 158 | { |
159 | wprintf (L"Failed to get spawn process `%s' with arguments `%s': %lu\n", wpath, wcmd, GetLastError ()); | 159 | wprintf (L"Failed to get spawn process `%S' with arguments `%S': %lu\n", wpath, wcmd, GetLastError ()); |
160 | exit (6); | 160 | exit (6); |
161 | } | 161 | } |
162 | 162 | ||