comparison common/logging.c @ 905:698b6a9bd75e

Fix coding style for C code astyle --style=gnu --indent=spaces=2
author Andre Heinecke <andre.heinecke@intevation.de>
date Wed, 13 Aug 2014 15:49:47 +0200
parents 2303caf56dbb
children
comparison
equal deleted inserted replaced
904:f89b41fa7048 905:698b6a9bd75e
135 FORMAT_MESSAGE_IGNORE_INSERTS, 135 FORMAT_MESSAGE_IGNORE_INSERTS,
136 hWinhttp, HRESULT_CODE (err), 0, 136 hWinhttp, HRESULT_CODE (err), 0,
137 (LPWSTR) &bufPtr, 0, NULL); 137 (LPWSTR) &bufPtr, 0, NULL);
138 } 138 }
139 } 139 }
140 if (!bufPtr) { 140 if (!bufPtr)
141 fprintf (stderr, "Error getting last error for code: %lx \n", err); 141 {
142 return NULL; 142 fprintf (stderr, "Error getting last error for code: %lx \n", err);
143 } 143 return NULL;
144 }
144 145
145 retval = wchar_to_utf8(bufPtr, wcslen(bufPtr)); 146 retval = wchar_to_utf8(bufPtr, wcslen(bufPtr));
146 LocalFree (bufPtr); 147 LocalFree (bufPtr);
147 148
148 return retval; 149 return retval;
215 snprintf (fingerprint + (31 * 3), 3, "%02X", sha256sum[31]); 216 snprintf (fingerprint + (31 * 3), 3, "%02X", sha256sum[31]);
216 217
217 fingerprint[32*3] = '\0'; 218 fingerprint[32*3] = '\0';
218 219
219 #ifdef WIN32 220 #ifdef WIN32
220 { 221 {
221 wchar_t *wstrings[3]; 222 wchar_t *wstrings[3];
222 223
223 wstrings[0] = utf8_to_wchar (subject, strnlen (subject, MAX_LOG)); 224 wstrings[0] = utf8_to_wchar (subject, strnlen (subject, MAX_LOG));
224 wstrings[1] = utf8_to_wchar (fingerprint, strnlen (fingerprint, MAX_LOG)); 225 wstrings[1] = utf8_to_wchar (fingerprint, strnlen (fingerprint, MAX_LOG));
225 wstrings[2] = utf8_to_wchar (store, strnlen (store, MAX_LOG)); 226 wstrings[2] = utf8_to_wchar (store, strnlen (store, MAX_LOG));
226 227
227 win_do_log (EVENTLOG_INFORMATION_TYPE, 228 win_do_log (EVENTLOG_INFORMATION_TYPE,
228 EVENT_CAT_CINST, 229 EVENT_CAT_CINST,
229 install ? MSG_CERT_INSTALL : MSG_CERT_REMOVE, 230 install ? MSG_CERT_INSTALL : MSG_CERT_REMOVE,
230 3, 231 3,
231 (const WCHAR**) wstrings); 232 (const WCHAR**) wstrings);
232 xfree (wstrings[0]); 233 xfree (wstrings[0]);
233 xfree (wstrings[1]); 234 xfree (wstrings[1]);
234 xfree (wstrings[2]); 235 xfree (wstrings[2]);
235 } 236 }
236 #else 237 #else
237 /* Please keep the following line in line with message from events.mc */ 238 /* Please keep the following line in line with message from events.mc */
238 syslog_info_printf ("%s of root certificate: %s Sha256 thumbprint:<%s>. Certificate store \"%s\"", 239 syslog_info_printf ("%s of root certificate: %s Sha256 thumbprint:<%s>. Certificate store \"%s\"",
239 install ? "Installation" : "Removal", 240 install ? "Installation" : "Removal",
240 subject, fingerprint, store); 241 subject, fingerprint, store);

http://wald.intevation.org/projects/trustbridge/