]> git.ipfire.org Git - thirdparty/squid.git/blobdiff - compat/xstrerror.cc
SourceFormat Enforcement
[thirdparty/squid.git] / compat / xstrerror.cc
index 363efcaf55020979847fc2e719b2562e82783b82..97f2702e526b8bb9ec9650087ee8356c169c4015 100644 (file)
@@ -1,9 +1,15 @@
+/*
+ * Copyright (C) 1996-2017 The Squid Software Foundation and contributors
+ *
+ * Squid software is distributed under GPLv2+ license and includes
+ * contributions from numerous individuals and organizations.
+ * Please see the COPYING and CONTRIBUTORS files for details.
+ */
+
 #include "squid.h"
 #include "compat/xstrerror.h"
 
-#if HAVE_STRING_H
-#include <string.h>
-#endif
+#include <cstring>
 
 #if _SQUID_WINDOWS_
 static struct _wsaerrtext {
@@ -83,7 +89,7 @@ xstrerr(int error)
 
 #if _SQUID_WINDOWS_
     // Description of WSAGetLastError()
-    for (size_t i = 0; i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); i++) {
+    for (size_t i = 0; i < sizeof(_wsaerrtext) / sizeof(struct _wsaerrtext); ++i) {
         if (_wsaerrtext[i].err == error) {
             // small optimization, save using a temporary buffer and two copies...
             snprintf(xstrerror_buf, BUFSIZ, "(%d) %s, %s", error, _wsaerrtext[i].errconst, _wsaerrtext[i].errdesc);
@@ -101,3 +107,4 @@ xstrerr(int error)
 
     return xstrerror_buf;
 }
+