summaryrefslogtreecommitdiff
path: root/lib/util
diff options
context:
space:
mode:
authorAndreas Schneider <asn@samba.org>2023-04-13 13:29:32 +0200
committerAndreas Schneider <asn@cryptomilk.org>2023-04-14 05:25:33 +0000
commitcfa53c8a80134dea025bd9cfe7b9c6518e75cae6 (patch)
treea2af66f849ae479a20929e99357b81d03541ec8a /lib/util
parentb3271603779a04beee795c5ba8244923b4d04ef4 (diff)
downloadsamba-cfa53c8a80134dea025bd9cfe7b9c6518e75cae6.tar.gz
lib:util: Fix code spelling
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Diffstat (limited to 'lib/util')
-rw-r--r--lib/util/access.c4
-rw-r--r--lib/util/byteorder.h2
-rw-r--r--lib/util/charset/charset_macosxfs.c16
-rw-r--r--lib/util/charset/codepoints.c2
-rw-r--r--lib/util/charset/iconv.c4
-rw-r--r--lib/util/charset/pull_push.c2
-rw-r--r--lib/util/charset/tests/convert_string.c376
-rw-r--r--lib/util/charset/util_unistr.c4
-rw-r--r--lib/util/debug.h8
-rw-r--r--lib/util/memcache.h2
-rw-r--r--lib/util/modules.c2
-rw-r--r--lib/util/ms_fnmatch.c2
-rw-r--r--lib/util/params.c2
-rw-r--r--lib/util/rfc1738.c2
-rw-r--r--lib/util/samba_util.h8
-rw-r--r--lib/util/smb_strtox.c4
-rw-r--r--lib/util/string_wrappers.h2
-rw-r--r--lib/util/tests/asn1_tests.c2
-rw-r--r--lib/util/tests/rfc1738.c2
-rw-r--r--lib/util/tfork.c6
-rw-r--r--lib/util/tfork.h2
-rw-r--r--lib/util/time.c4
-rw-r--r--lib/util/util.c2
23 files changed, 230 insertions, 230 deletions
diff --git a/lib/util/access.c b/lib/util/access.c
index f4b5ae79125..fd9912db873 100644
--- a/lib/util/access.c
+++ b/lib/util/access.c
@@ -309,7 +309,7 @@ static bool allow_access_internal(const char **deny_list,
return true;
}
- /* if theres no deny list and no allow list then allow access */
+ /* if there's no deny list and no allow list then allow access */
if ((!deny_list || *deny_list == 0) &&
(!allow_list || *allow_list == 0)) {
return true;
@@ -321,7 +321,7 @@ static bool allow_access_internal(const char **deny_list,
return(list_match(allow_list,client,client_match));
}
- /* if theres a deny list but no allow list then allow
+ /* if there's a deny list but no allow list then allow
all hosts not on the deny list */
if (!allow_list || *allow_list == 0) {
return(!list_match(deny_list,client,client_match));
diff --git a/lib/util/byteorder.h b/lib/util/byteorder.h
index 036cd6d1eb2..26268ac93cd 100644
--- a/lib/util/byteorder.h
+++ b/lib/util/byteorder.h
@@ -55,7 +55,7 @@ then to extract a uint16_t value at offset 25 in a buffer you do this:
char *buffer = foo_bar();
uint16_t xx = SVAL(buffer,25);
-We are using the byteoder independence of the ANSI C bitshifts to do
+We are using the byteorder independence of the ANSI C bitshifts to do
the work. A good optimising compiler should turn this into efficient
code, especially if it happens to have the right byteorder :-)
diff --git a/lib/util/charset/charset_macosxfs.c b/lib/util/charset/charset_macosxfs.c
index 75dbb4bad87..2ecfdff74f9 100644
--- a/lib/util/charset/charset_macosxfs.c
+++ b/lib/util/charset/charset_macosxfs.c
@@ -1,18 +1,18 @@
-/*
+/*
Unix SMB/CIFS implementation.
Samba charset module for Mac OS X/Darwin
Copyright (C) Benjamin Riefenstahl 2003
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -247,7 +247,7 @@ size_t macosxfs_encoding_pull(
} else {
/*
* We would like to use a fixed buffer and a loop
- * here, but than we can't garantee that the input is
+ * here, but then we can't guarantee that the input is
* well-formed UTF-8, as we are supposed to do.
*/
static char *buffer = NULL;
@@ -304,7 +304,7 @@ size_t macosxfs_encoding_pull(
* Add a converted null byte, if the CFString conversions
* prevented that until now.
*/
- if (0 == (*inbuf)[*inbytesleft-1] &&
+ if (0 == (*inbuf)[*inbytesleft-1] &&
(0 != (*outbuf)[outsize*2-1] || 0 != (*outbuf)[outsize*2-2])) {
if ((outsize*2+2) > *outbytesleft) {
@@ -383,7 +383,7 @@ size_t macosxfs_encoding_push(
if (0 == charsconverted) {
debug_out("String conversion: "
- "Buffer too small or not convertable\n");
+ "Buffer too small or not convertible\n");
hexdump("UTF16LE->UTF8 (old) input",
*inbuf, *inbytesleft);
errno = EILSEQ; /* Probably more likely. */
@@ -595,7 +595,7 @@ static size_t macosxfs_encoding_push(
#endif /* USE_INTERNAL_API */
#else /* DARWIN */
-
+
void charset_macosfs_dummy(void);
void charset_macosfs_dummy(void)
{
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c
index c35241e2983..c39ed4a8436 100644
--- a/lib/util/charset/codepoints.c
+++ b/lib/util/charset/codepoints.c
@@ -16664,7 +16664,7 @@ smb_iconv_t get_conv_handle(struct smb_iconv_handle *ic,
/**
* Return the unicode codepoint for the next character in the input
* string in the given src_charset.
- * The unicode codepoint (codepoint_t) is an unsinged 32 bit value.
+ * The unicode codepoint (codepoint_t) is an unsigned 32 bit value.
*
* Also return the number of bytes consumed (which tells the caller
* how many bytes to skip to get to the next src_charset-character).
diff --git a/lib/util/charset/iconv.c b/lib/util/charset/iconv.c
index 43b3306b0de..30e705ee119 100644
--- a/lib/util/charset/iconv.c
+++ b/lib/util/charset/iconv.c
@@ -213,7 +213,7 @@ static size_t sys_uconv(void *cd,
/*
* The following transliteration function takes two parameters, the
- * lenght of the text to be converted (converted_len) and a limit which
+ * length of the text to be converted (converted_len) and a limit which
* may be smaller then converted_len. We just set limit to converted_len
* and also ignore the value returned in limit.
*/
@@ -272,7 +272,7 @@ static size_t sys_uconv(void *cd,
#endif
/**
- * This is a simple portable iconv() implementaion.
+ * This is a simple portable iconv() implementation.
*
* It only knows about a very small number of character sets - just
* enough that Samba works on systems that don't have iconv.
diff --git a/lib/util/charset/pull_push.c b/lib/util/charset/pull_push.c
index 1a79e6aa400..c5ab2ac85c0 100644
--- a/lib/util/charset/pull_push.c
+++ b/lib/util/charset/pull_push.c
@@ -64,7 +64,7 @@ bool push_ucs2_talloc(TALLOC_CTX *ctx, smb_ucs2_t **dest, const char *src,
* The destination string should be free'd using talloc_free() if no longer
* needed.
*
- * @return True on succcess, false otherwise.
+ * @return True on success, false otherwise.
*/
bool push_utf8_talloc(TALLOC_CTX *ctx, char **dest, const char *src,
size_t *converted_size)
diff --git a/lib/util/charset/tests/convert_string.c b/lib/util/charset/tests/convert_string.c
index e99a2965a05..3c15cdc1d04 100644
--- a/lib/util/charset/tests/convert_string.c
+++ b/lib/util/charset/tests/convert_string.c
@@ -1,19 +1,19 @@
-/*
+/*
Unix SMB/CIFS implementation.
test suite for the charcnv functions
Copyright (C) Andrew Bartlett 2011
-
+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
-
+
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
@@ -34,7 +34,7 @@ struct torture_suite *torture_local_string_case(TALLOC_CTX *mem_ctx);
* http://en.wikipedia.org/w/index.php?title=Ancient_Greek&oldid=421361065#Example_text
*/
-const char *plato_english_ascii =
+const char *plato_english_ascii =
"What you, men of Athens, have learned from my accusers, I do not"
" know: but I, for my part, nearly forgot who I was thanks to them since"
" they spoke so persuasively. And yet, of the truth, they have spoken,"
@@ -51,7 +51,7 @@ const char *plato_english_utf16le_base64 =
"AGsAZQBuACwAIABvAG4AZQAgAG0AaQBnAGgAdAAgAHMAYQB5ACwAIABuAG8AdABoAGkAbgBnACAA"
"YQB0ACAAYQBsAGwALgA=";
-static const char *plato_utf8_base64 =
+static const char *plato_utf8_base64 =
"4b2Nz4TOuSDOvOG9ss69IOG9kc68zrXhv5bPgiwg4b2mIOG8hM69zrTPgc61z4IgzobOuM63zr3O"
"seG/ls6/zrksIM+AzrXPgM+Mzr3OuM6xz4TOtSDhvZHPgOG9uCDPhOG/ts69IOG8kM684b+2zr0g"
"zrrOsc+EzrfOs8+Mz4HPic69LCDOv+G9kM66IM6/4by2zrTOsTog4byQzrPhvbwgzrQnIM6/4b2W"
@@ -61,7 +61,7 @@ static const char *plato_utf8_base64 =
"4b2hz4Ig4byUz4DOv8+CIM614bywz4DOteG/ls69IM6/4b2QzrThvbLOvSDOteG8sM+Bzq7Ous6x"
"z4POuc69Lg==";
-static const char *plato_utf16le_base64 =
+static const char *plato_utf16le_base64 =
"TR/EA7kDIAC8A3IfvQMgAFEfvAO1A9YfwgMsACAAZh8gAAQfvQO0A8EDtQPCAyAAhgO4A7cDvQOx"
"A9YfvwO5AywAIADAA7UDwAPMA70DuAOxA8QDtQMgAFEfwAN4HyAAxAP2H70DIAAQH7wD9h+9AyAA"
"ugOxA8QDtwOzA8wDwQPJA70DLAAgAL8DUB+6AyAAvwM2H7QDsQM6ACAAEB+zA3wfIAC0AycAIAC/"
@@ -71,14 +71,14 @@ static const char *plato_utf16le_base64 =
"swO1AyAAYR/CAyAAFB/AA78DwgMgALUDMB/AA7UD1h+9AyAAvwNQH7QDch+9AyAAtQMwH8EDrgO6"
"A7EDwwO5A70DLgA=";
-static const char *plato_latin_utf8_base64 =
+static const char *plato_latin_utf8_base64 =
"SMOzdGkgbcOobiBodW1lw65zLCDDtCDDoW5kcmVzIEF0aMSTbmHDrm9pLCBwZXDDs250aGF0ZSBo"
"dXDDsiB0w7RuIGVtw7RuIGthdMSTZ8OzcsWNbiwgb3VrIG/DrmRhOiBlZ+G5kSBkJyBvw7tuIGth"
"w6wgYXV0w7JzIGh1cCcgYXV0xY1uIG9sw61nb3UgZW1hdXRvw7sgZXBlbGF0aMOzbcSTbiwgaG/D"
"unTFjSBwaXRoYW7DtHMgw6lsZWdvbi4gS2HDrXRvaSBhbMSTdGjDqXMgZ2UgaMWNcyDDqXBvcyBl"
"aXBlw65uIG91ZMOobiBlaXLhuJdrYXNpbi4=";
-static const char *plato_latin_utf16le_base64 =
+static const char *plato_latin_utf16le_base64 =
"SADzAHQAaQAgAG0A6ABuACAAaAB1AG0AZQDuAHMALAAgAPQAIADhAG4AZAByAGUAcwAgAEEAdABo"
"ABMBbgBhAO4AbwBpACwAIABwAGUAcADzAG4AdABoAGEAdABlACAAaAB1AHAA8gAgAHQA9ABuACAA"
"ZQBtAPQAbgAgAGsAYQB0ABMBZwDzAHIATQFuACwAIABvAHUAawAgAG8A7gBkAGEAOgAgAGUAZwBR"
@@ -161,7 +161,7 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
DATA_BLOB gd_utf16le = base64_decode_data_blob(gd_utf16le_base64);
DATA_BLOB gd_output;
DATA_BLOB gd_output2;
-
+
talloc_steal(tctx, gd_utf8.data);
talloc_steal(tctx, gd_cp850.data);
talloc_steal(tctx, gd_iso8859_1.data);
@@ -170,14 +170,14 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_DOS,
- gd_utf8.data, gd_utf8.length,
- (void *)&gd_output.data, &gd_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_DOS,
+ gd_utf8.data, gd_utf8.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from UTF8 to (dos charset) ISO-8859-1");
torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF8 to (dos charset) ISO-8859-1 incorrect");
-
+
torture_assert(tctx, convert_string_error_handle(iconv_handle,
CH_UTF8, CH_DOS,
gd_utf8.data, gd_utf8.length,
@@ -254,73 +254,73 @@ static bool test_gd_iso8859_cp850_handle(struct torture_context *tctx)
torture_assert_errno_equal(tctx, EINVAL, "conversion from short UTF16 to UTF8 should fail EINVAL");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 1 char of output");
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UNIX,
- gd_utf8.data, gd_utf8.length,
- (void *)&gd_output.data, &gd_output.length),
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UNIX,
+ gd_utf8.data, gd_utf8.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from UTF8 to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, gd_output, gd_cp850, "conversion from UTF8 to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UTF8,
- gd_utf8.data, gd_utf8.length,
- (void *)&gd_output.data, &gd_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UTF8,
+ gd_utf8.data, gd_utf8.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from UTF8 to UTF8");
torture_assert_data_blob_equal(tctx, gd_output, gd_utf8, "conversion from UTF8 to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_DOS,
- gd_utf16le.data, gd_utf16le.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_DOS,
+ gd_utf16le.data, gd_utf16le.length,
(void *)&gd_output.data, &gd_output.length),
"conversion from UTF16LE to (dos charset) ISO-8859-1");
torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UTF16LE,
- gd_output.data, gd_output.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UTF16LE,
+ gd_output.data, gd_output.length,
(void *)&gd_output2.data, &gd_output2.length),
"round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
torture_assert_data_blob_equal(tctx, gd_output2, gd_utf16le, "round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UNIX,
- gd_utf16le.data, gd_utf16le.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UNIX,
+ gd_utf16le.data, gd_utf16le.length,
(void *)&gd_output.data, &gd_output.length),
"conversion from UTF16LE to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, gd_output, gd_cp850, "conversion from UTF16LE to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UTF8,
- gd_utf16le.data, gd_utf16le.length,
- (void *)&gd_output.data, &gd_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UTF8,
+ gd_utf16le.data, gd_utf16le.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from UTF16LE to UTF8");
torture_assert_data_blob_equal(tctx, gd_output, gd_utf8, "conversion from UTF16LE to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_DOS,
- gd_iso8859_1.data, gd_iso8859_1.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_DOS,
+ gd_iso8859_1.data, gd_iso8859_1.length,
(void *)&gd_output.data, &gd_output.length),
"conversion from (dos charset) ISO-8859-1 to (dos charset) ISO-8859-1");
torture_assert_data_blob_equal(tctx, gd_output, gd_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UNIX,
- gd_iso8859_1.data, gd_iso8859_1.length,
- (void *)&gd_output.data, &gd_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UNIX,
+ gd_iso8859_1.data, gd_iso8859_1.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from (dos charset) ISO-8859-1 to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, gd_output, gd_cp850, "conversion from UTF16LE to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UTF8,
- gd_iso8859_1.data, gd_iso8859_1.length,
- (void *)&gd_output.data, &gd_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UTF8,
+ gd_iso8859_1.data, gd_iso8859_1.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from (dos charset) ISO-8859-1 to UTF8");
torture_assert_data_blob_equal(tctx, gd_output, gd_utf8, "conversion from UTF16LE to UTF8 incorrect");
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UTF16LE,
- gd_iso8859_1.data, gd_iso8859_1.length,
- (void *)&gd_output.data, &gd_output.length),
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UTF16LE,
+ gd_iso8859_1.data, gd_iso8859_1.length,
+ (void *)&gd_output.data, &gd_output.length),
"conversion from (dos charset) ISO-8859-1 to UTF16LE");
torture_assert_data_blob_equal(tctx, gd_output, gd_utf16le, "conversion from (dos charset) ISO-8859-1 to UTF16LE");
torture_assert_int_equal(tctx,
@@ -355,12 +355,12 @@ static bool test_gd_minus_1_handle(struct torture_context *tctx)
DATA_BLOB gd_utf8_terminated;
DATA_BLOB gd_cp850_terminated;
DATA_BLOB gd_utf16le_terminated;
-
+
talloc_steal(tctx, gd_utf8.data);
talloc_steal(tctx, gd_cp850.data);
talloc_steal(tctx, gd_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "CP850", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "CP850", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
@@ -502,11 +502,11 @@ static bool test_gd_minus_1_handle(struct torture_context *tctx)
(void *)gd_output.data, gd_output.length, &gd_output.length),
"conversion from UTF16LE to UTF8 null terminated");
torture_assert_data_blob_equal(tctx, gd_output, gd_cp850_terminated, "conversion from UTF16LE to UTF8 null terminated early");
-
+
/* Now null terminate the string particularly early, the confirm we don't skip the NULL and convert any further */
gd_utf8_terminated.data[1] = '\0';
gd_utf8_terminated.length = 2; /* used for the comparison only */
-
+
gd_utf16le_terminated.data[2] = '\0';
gd_utf16le_terminated.data[3] = '\0';
gd_utf16le_terminated.length = 4; /* used for the comparison only */
@@ -545,7 +545,7 @@ static bool test_gd_ascii_handle(struct torture_context *tctx)
talloc_steal(tctx, gd_iso8859_1.data);
talloc_steal(tctx, gd_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ASCII", "UTF8",
+ iconv_handle = get_iconv_testing_handle(tctx, "ASCII", "UTF8",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
@@ -586,7 +586,7 @@ static bool test_gd_ascii_handle(struct torture_context *tctx)
gd_utf8.data, gd_utf8.length,
(void *)gd_output.data, gd_output.length,
&gd_output.length) == false,
- "conversion from UTF8 to (dos charset) ASCII should fail due to too illigal seqence");
+ "conversion from UTF8 to (dos charset) ASCII should fail due to illegal sequence");
torture_assert_errno_equal(tctx, EILSEQ, "conversion from UTF8 to (dos charset) ISO-8859-1 should fail EILSEQ");
torture_assert_int_equal(tctx, gd_output.length, 1, "Should only get 2 char of output");
@@ -612,49 +612,49 @@ static bool test_plato_english_iso8859_cp850_handle(struct torture_context *tctx
DATA_BLOB plato_english_utf16le = base64_decode_data_blob(plato_english_utf16le_base64);
DATA_BLOB plato_english_output;
DATA_BLOB plato_english_output2;
-
+
talloc_steal(tctx, plato_english_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_DOS,
- plato_english_utf8.data, plato_english_utf8.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_DOS,
+ plato_english_utf8.data, plato_english_utf8.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from UTF8 to (dos charset) ISO-8859-1");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF8 to (dos charset) ISO-8859-1 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UNIX,
- plato_english_utf8.data, plato_english_utf8.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UNIX,
+ plato_english_utf8.data, plato_english_utf8.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from UTF8 to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_cp850, "conversion from UTF8 to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UTF8,
- plato_english_utf8.data, plato_english_utf8.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UTF8,
+ plato_english_utf8.data, plato_english_utf8.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from UTF8 to UTF8");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf8, "conversion from UTF8 to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_DOS,
- plato_english_utf16le.data, plato_english_utf16le.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_DOS,
+ plato_english_utf16le.data, plato_english_utf16le.length,
(void *)&plato_english_output.data, &plato_english_output.length),
"conversion from UTF16LE to (dos charset) ISO-8859-1");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UTF16LE,
- plato_english_output.data, plato_english_output.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UTF16LE,
+ plato_english_output.data, plato_english_output.length,
(void *)&plato_english_output2.data, &plato_english_output2.length),
"round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
torture_assert_data_blob_equal(tctx, plato_english_output2, plato_english_utf16le, "round trip conversion from (dos charset) ISO-8859-1 back to UTF16LE");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_UTF16LE, CH_UTF8,
plato_english_utf16le.data, plato_english_utf16le.length,
(void *)&plato_english_output.data, &plato_english_output.length),
@@ -680,44 +680,44 @@ static bool test_plato_english_iso8859_cp850_handle(struct torture_context *tctx
torture_assert_int_equal(tctx, plato_english_output.length, 5, "short conversion failed");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UNIX,
- plato_english_utf16le.data, plato_english_utf16le.length,
+ CH_UTF16LE, CH_UNIX,
+ plato_english_utf16le.data, plato_english_utf16le.length,
(void *)&plato_english_output.data, &plato_english_output.length),
"conversion from UTF16LE to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_cp850, "conversion from UTF16LE to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UTF8,
- plato_english_utf16le.data, plato_english_utf16le.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UTF8,
+ plato_english_utf16le.data, plato_english_utf16le.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from UTF16LE to UTF8");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf8, "conversion from UTF16LE to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_DOS,
- plato_english_iso8859_1.data, plato_english_iso8859_1.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_DOS,
+ plato_english_iso8859_1.data, plato_english_iso8859_1.length,
(void *)&plato_english_output.data, &plato_english_output.length),
"conversion from (dos charset) ISO-8859-1 to (dos charset) ISO-8859-1");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_iso8859_1, "conversion from UTF16LE to (dos charset) ISO-8859-1 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UNIX,
- plato_english_iso8859_1.data, plato_english_iso8859_1.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UNIX,
+ plato_english_iso8859_1.data, plato_english_iso8859_1.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from (dos charset) ISO-8859-1 to (unix charset) CP850");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_cp850, "conversion from UTF16LE to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UTF8,
- plato_english_iso8859_1.data, plato_english_iso8859_1.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UTF8,
+ plato_english_iso8859_1.data, plato_english_iso8859_1.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from (dos charset) ISO-8859-1 to UTF8");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf8, "conversion from UTF16LE to UTF8 incorrect");
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_DOS, CH_UTF16LE,
- plato_english_iso8859_1.data, plato_english_iso8859_1.length,
- (void *)&plato_english_output.data, &plato_english_output.length),
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_DOS, CH_UTF16LE,
+ plato_english_iso8859_1.data, plato_english_iso8859_1.length,
+ (void *)&plato_english_output.data, &plato_english_output.length),
"conversion from (dos charset) ISO-8859-1 to UTF16LE");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf16le, "conversion from (dos charset) ISO-8859-1 to UTF16LE");
return true;
@@ -731,10 +731,10 @@ static bool test_plato_english_minus_1_handle(struct torture_context *tctx)
DATA_BLOB plato_english_output;
DATA_BLOB plato_english_utf8_terminated;
DATA_BLOB plato_english_utf16le_terminated;
-
+
talloc_steal(tctx, plato_english_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
+ iconv_handle = get_iconv_testing_handle(tctx, "ISO-8859-1", "CP850",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "getting iconv handle");
@@ -746,7 +746,7 @@ static bool test_plato_english_minus_1_handle(struct torture_context *tctx)
memcpy(plato_english_utf16le_terminated.data, plato_english_utf16le.data, plato_english_utf16le.length);
plato_english_utf16le_terminated.data[plato_english_utf16le.length] = '\0';
plato_english_utf16le_terminated.data[plato_english_utf16le.length + 1] = '\0';
-
+
plato_english_output = data_blob_talloc(tctx, NULL, plato_english_utf16le.length + 10);
torture_assert(tctx, convert_string_error_handle(iconv_handle,
@@ -835,11 +835,11 @@ static bool test_plato_english_minus_1_handle(struct torture_context *tctx)
"conversion from UTF16LE to UTF8 null terminated");
torture_assert_data_blob_equal(tctx, plato_english_output, plato_english_utf8_terminated, "conversion from UTF16LE to UTF8 null terminated early");
-
+
/* Now null terminate the string particularly early, the confirm we don't skip the NULL and convert any further */
plato_english_utf8_terminated.data[1] = '\0';
plato_english_utf8_terminated.length = 2; /* used for the comparison only */
-
+
plato_english_utf16le_terminated.data[2] = '\0';
plato_english_utf16le_terminated.data[3] = '\0';
plato_english_utf16le_terminated.length = 4; /* used for the comparison only */
@@ -872,7 +872,7 @@ static bool test_plato_minus_1_handle(struct torture_context *tctx)
DATA_BLOB plato_output;
DATA_BLOB plato_utf8_terminated;
DATA_BLOB plato_utf16le_terminated;
-
+
talloc_steal(tctx, plato_utf8.data);
talloc_steal(tctx, plato_utf16le.data);
@@ -976,7 +976,7 @@ static bool test_plato_minus_1_handle(struct torture_context *tctx)
(void *)plato_output.data, plato_output.length, &plato_output.length),
"conversion from UTF16LE to UTF8 null terminated");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8_terminated, "conversion from UTF16LE to UTF8 null terminated early");
-
+
return true;
}
@@ -987,15 +987,15 @@ static bool test_plato_cp850_utf8_handle(struct torture_context *tctx)
DATA_BLOB plato_utf16le = base64_decode_data_blob(plato_utf16le_base64);
DATA_BLOB plato_output;
DATA_BLOB plato_output2;
-
+
talloc_steal(tctx, plato_utf8.data);
talloc_steal(tctx, plato_utf16le.data);
- iconv_handle = get_iconv_testing_handle(tctx, "CP850", "UTF8",
+ iconv_handle = get_iconv_testing_handle(tctx, "CP850", "UTF8",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "creating iconv handle");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
CH_UTF8, CH_UTF16LE,
plato_utf8.data, plato_utf8.length,
(void *)&plato_output.data, &plato_output.length),
@@ -1055,18 +1055,18 @@ static bool test_plato_cp850_utf8_handle(struct torture_context *tctx)
"conversion of UTF8 to UTF8");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_DOS,
- plato_utf8.data, plato_utf8.length,
- (void *)&plato_output.data, &plato_output.length) == false,
+ CH_UTF8, CH_DOS,
+ plato_utf8.data, plato_utf8.length,
+ (void *)&plato_output.data, &plato_output.length) == false,
"conversion of UTF8 ancient greek to DOS charset CP850 should fail");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UNIX,
- plato_utf8.data, plato_utf8.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UNIX,
+ plato_utf8.data, plato_utf8.length,
(void *)&plato_output.data, &plato_output.length),
"conversion of UTF16 ancient greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8, "conversion from UTF8 to (unix charset) UTF8 incorrect");
-
+
memset(plato_output.data, '\0', plato_output.length);
torture_assert(tctx, convert_string_error_handle(iconv_handle,
CH_UTF8, CH_UNIX,
@@ -1076,17 +1076,17 @@ static bool test_plato_cp850_utf8_handle(struct torture_context *tctx)
"conversion of UTF16 ancient greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8, "conversion from UTF8 to (unix charset) UTF8 incorrect");
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UTF8,
- plato_utf8.data, plato_utf8.length,
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UTF8,
+ plato_utf8.data, plato_utf8.length,
(void *)&plato_output.data, &plato_output.length),
"conversion of UTF16 ancient greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8, "conversion from UTF8 to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_DOS,
- plato_utf16le.data, plato_utf16le.length,
- (void *)&plato_output.data, &plato_output.length) == false,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_DOS,
+ plato_utf16le.data, plato_utf16le.length,
+ (void *)&plato_output.data, &plato_output.length) == false,
"conversion of UTF16 ancient greek to DOS charset CP850 should fail");
/* Allocate enough space, if it were possible do do the conversion */
@@ -1123,10 +1123,10 @@ static bool test_plato_cp850_utf8_handle(struct torture_context *tctx)
"conversion of UTF16 ancient greek to UTF8 should stop on multibyte boundary");
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UNIX,
- plato_utf16le.data, plato_utf16le.length,
- (void *)&plato_output.data, &plato_output.length),
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UNIX,
+ plato_utf16le.data, plato_utf16le.length,
+ (void *)&plato_output.data, &plato_output.length),
"conversion of UTF16 ancient greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8, "conversion from UTF16LE to (unix charset) UTF8 incorrect");
torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
@@ -1135,16 +1135,16 @@ static bool test_plato_cp850_utf8_handle(struct torture_context *tctx)
(void *)&plato_output.data, &plato_output.length),
"conversion of UTF16 ancient greek to UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8, "conversion from UTF16LE to UTF8 incorrect");
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UTF8,
- plato_utf16le.data, plato_utf16le.length,
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UTF8,
+ plato_utf16le.data, plato_utf16le.length,
(void *)&plato_output.data, &plato_output.length),
"conversion of UTF16 ancient greek to UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_output, plato_utf8, "conversion from UTF16LE to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UTF16LE,
- plato_output.data, plato_output.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UTF16LE,
+ plato_output.data, plato_output.length,
(void *)&plato_output2.data, &plato_output2.length),
"round trip conversion of UTF16 ancient greek to UTF8 and back again failed");
torture_assert_data_blob_equal(tctx, plato_output2, plato_utf16le,
@@ -1179,57 +1179,57 @@ static bool test_plato_latin_cp850_utf8_handle(struct torture_context *tctx)
DATA_BLOB plato_latin_utf16le = base64_decode_data_blob(plato_latin_utf16le_base64);
DATA_BLOB plato_latin_output;
DATA_BLOB plato_latin_output2;
-
+
talloc_steal(tctx, plato_latin_utf8.data);
talloc_steal(tctx, plato_latin_utf16le.data);
iconv_handle = get_iconv_testing_handle(tctx, "CP850", "UTF8",
lpcfg_parm_bool(tctx->lp_ctx, NULL, "iconv", "use_builtin_handlers", true));
torture_assert(tctx, iconv_handle, "creating iconv handle");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_DOS,
- plato_latin_utf8.data, plato_latin_utf8.length,
- (void *)&plato_latin_output.data, &plato_latin_output.length) == false,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_DOS,
+ plato_latin_utf8.data, plato_latin_utf8.length,
+ (void *)&plato_latin_output.data, &plato_latin_output.length) == false,
"conversion of UTF8 latin charset greek to DOS charset CP850 should fail");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UNIX,
- plato_latin_utf8.data, plato_latin_utf8.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UNIX,
+ plato_latin_utf8.data, plato_latin_utf8.length,
(void *)&plato_latin_output.data, &plato_latin_output.length),
"conversion of UTF16 latin charset greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_latin_output, plato_latin_utf8, "conversion from UTF8 to (unix charset) UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UTF8,
- plato_latin_utf8.data, plato_latin_utf8.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UTF8,
+ plato_latin_utf8.data, plato_latin_utf8.length,
(void *)&plato_latin_output.data, &plato_latin_output.length),
"conversion of UTF16 latin charset greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_latin_output, plato_latin_utf8, "conversion from UTF8 to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_DOS,
- plato_latin_utf16le.data, plato_latin_utf16le.length,
- (void *)&plato_latin_output.data, &plato_latin_output.length) == false,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_DOS,
+ plato_latin_utf16le.data, plato_latin_utf16le.length,
+ (void *)&plato_latin_output.data, &plato_latin_output.length) == false,
"conversion of UTF16 latin charset greek to DOS charset CP850 should fail");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UNIX,
- plato_latin_utf16le.data, plato_latin_utf16le.length,
- (void *)&plato_latin_output.data, &plato_latin_output.length),
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UNIX,
+ plato_latin_utf16le.data, plato_latin_utf16le.length,
+ (void *)&plato_latin_output.data, &plato_latin_output.length),
"conversion of UTF16 latin charset greek to unix charset UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_latin_output, plato_latin_utf8, "conversion from UTF16LE to (unix charset) CP850 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF16LE, CH_UTF8,
- plato_latin_utf16le.data, plato_latin_utf16le.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF16LE, CH_UTF8,
+ plato_latin_utf16le.data, plato_latin_utf16le.length,
(void *)&plato_latin_output.data, &plato_latin_output.length),
"conversion of UTF16 latin charset greek to UTF8 failed");
torture_assert_data_blob_equal(tctx, plato_latin_output, plato_latin_utf8, "conversion from UTF16LE to UTF8 incorrect");
-
- torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
- CH_UTF8, CH_UTF16LE,
- plato_latin_output.data, plato_latin_output.length,
+
+ torture_assert(tctx, convert_string_talloc_handle(tctx, iconv_handle,
+ CH_UTF8, CH_UTF16LE,
+ plato_latin_output.data, plato_latin_output.length,
(void *)&plato_latin_output2.data, &plato_latin_output2.length),
"round trip conversion of UTF16 latin charset greek to UTF8 and back again failed");
torture_assert_data_blob_equal(tctx, plato_latin_output2, plato_latin_utf16le,
diff --git a/lib/util/charset/util_unistr.c b/lib/util/charset/util_unistr.c
index 4658d91b0c8..f8cadf28507 100644
--- a/lib/util/charset/util_unistr.c
+++ b/lib/util/charset/util_unistr.c
@@ -313,7 +313,7 @@ static ssize_t pull_ascii_string(char *dest, const void *src, size_t dest_len, s
* </dl>
*
* @param dest_len is the maximum length allowed in the
- * destination. If dest_len is -1 then no maxiumum is used.
+ * destination. If dest_len is -1 then no maximum is used.
**/
static ssize_t push_ucs2(void *dest, const char *src, size_t dest_len, int flags)
{
@@ -409,7 +409,7 @@ static size_t pull_ucs2(char *dest, const void *src, size_t dest_len, size_t src
STR_ASCII use ascii even with unicode packet.
STR_NOALIGN means don't do alignment.
dest_len is the maximum length allowed in the destination. If dest_len
- is -1 then no maxiumum is used.
+ is -1 then no maximum is used.
**/
_PUBLIC_ ssize_t push_string(void *dest, const char *src, size_t dest_len, int flags)
diff --git a/lib/util/debug.h b/lib/util/debug.h
index 4e5ce3da035..335a644718f 100644
--- a/lib/util/debug.h
+++ b/lib/util/debug.h
@@ -50,7 +50,7 @@ bool dbgsetclass(int level, int cls);
/*
* Define all new debug classes here. A class is represented by an entry in
- * the DEBUGLEVEL_CLASS array. Index zero of this arrray is equivalent to the
+ * the DEBUGLEVEL_CLASS array. Index zero of this array is equivalent to the
* old DEBUGLEVEL. Any source file that does NOT add the following lines:
*
* #undef DBGC_CLASS
@@ -113,7 +113,7 @@ bool dbgsetclass(int level, int cls);
*
* DEBUGLVL()
* If the 'file specific' debug class level >= level OR the system-wide
- * DEBUGLEVEL (synomym for DEBUGLEVEL_CLASS[ DBGC_ALL ]) >= level then
+ * DEBUGLEVEL (synonym for DEBUGLEVEL_CLASS[ DBGC_ALL ]) >= level then
* generate a header using the default macros for file, line, and
* function name. Returns True if the debug level was <= DEBUGLEVEL.
*
@@ -121,7 +121,7 @@ bool dbgsetclass(int level, int cls);
*
* DEBUG()
* If the 'file specific' debug class level >= level OR the system-wide
- * DEBUGLEVEL (synomym for DEBUGLEVEL_CLASS[ DBGC_ALL ]) >= level then
+ * DEBUGLEVEL (synonym for DEBUGLEVEL_CLASS[ DBGC_ALL ]) >= level then
* generate a header using the default macros for file, line, and
* function name. Each call to DEBUG() generates a new header *unless* the
* previous debug output was unterminated (i.e. no '\n').
@@ -131,7 +131,7 @@ bool dbgsetclass(int level, int cls);
*
* DEBUGC()
* If the 'macro specified' debug class level >= level OR the system-wide
- * DEBUGLEVEL (synomym for DEBUGLEVEL_CLASS[ DBGC_ALL ]) >= level then
+ * DEBUGLEVEL (synonym for DEBUGLEVEL_CLASS[ DBGC_ALL ]) >= level then
* generate a header using the default macros for file, line, and
* function name. Each call to DEBUG() generates a new header *unless* the
* previous debug output was unterminated (i.e. no '\n').
diff --git a/lib/util/memcache.h b/lib/util/memcache.h
index 1e13e334191..803af813025 100644
--- a/lib/util/memcache.h
+++ b/lib/util/memcache.h
@@ -73,7 +73,7 @@ void memcache_add(struct memcache *cache, enum memcache_number n,
/*
* Add a talloc object to the cache. The difference to memcache_add() is that
- * when the objects is to be discared, talloc_free is called for it. Also
+ * when the objects is to be discarded, talloc_free is called for it. Also
* talloc_move() ownership of the object to the cache.
*
* Please note that the current implementation has a fixed relationship
diff --git a/lib/util/modules.c b/lib/util/modules.c
index 5d49ed95df0..4260234b007 100644
--- a/lib/util/modules.c
+++ b/lib/util/modules.c
@@ -257,7 +257,7 @@ done:
*
* @param[in] subsystem The name of the subsystem the module belongs too.
*
- * @param[in] module Load a module using an abolute path.
+ * @param[in] module Load a module using an absolute path.
*
* @return A NTSTATUS code
*/
diff --git a/lib/util/ms_fnmatch.c b/lib/util/ms_fnmatch.c
index 90aab13ec90..48454a8ecce 100644
--- a/lib/util/ms_fnmatch.c
+++ b/lib/util/ms_fnmatch.c
@@ -19,7 +19,7 @@
/*
This module was originally based on fnmatch.c copyright by the Free
- Software Foundation. It bears little (if any) resemblence to that
+ Software Foundation. It bears little (if any) resemblance to that
code now
*/
diff --git a/lib/util/params.c b/lib/util/params.c
index 79b45ee2fcb..dac77825af8 100644
--- a/lib/util/params.c
+++ b/lib/util/params.c
@@ -64,7 +64,7 @@
* beginning with either a semicolon (';') or a pound sign ('#').
*
* All whitespace in section names and parameter names is compressed
- * to single spaces. Leading and trailing whitespace is stipped from
+ * to single spaces. Leading and trailing whitespace is stripped from
* both names and values.
*
* Only the first equals sign in a parameter line is significant.
diff --git a/lib/util/rfc1738.c b/lib/util/rfc1738.c
index 82395446bc8..7b8db11fda3 100644
--- a/lib/util/rfc1738.c
+++ b/lib/util/rfc1738.c
@@ -60,7 +60,7 @@
* and whatever is not in either of those are what RFC 1738 called "unsafe",
* meaning that they should are canonically but not mandatorily escaped.
*
- * Characters below 0x20 or above 0x7E are always enocded.
+ * Characters below 0x20 or above 0x7E are always encoded.
*/
static const unsigned char escapees[127] = {
diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 95470a066a3..e672b4b00b2 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -118,7 +118,7 @@ _PUBLIC_ uint64_t generate_random_u64_range(uint64_t lower, uint64_t upper);
* This is much lighter than generate_random_u64() and it's
* designed for performance critical code paths.
*
- * @veto_value It is garanteed that the return value if different from
+ * @veto_value It is guaranteed that the return value is different from
* the veto_value.
*
* @return a unique value per given state and process
@@ -158,7 +158,7 @@ _PUBLIC_ char *generate_random_password(TALLOC_CTX *mem_ctx, size_t min, size_t
*
* If 'unix charset' is 'utf8' (the default) then
* each utf16 character is a random value from 0x0000
- * 0xFFFF (exluding the surrogate ranges from 0xD800-0xDFFF)
+ * 0xFFFF (excluding the surrogate ranges from 0xD800-0xDFFF)
* while the translation from CH_UTF16MUNGED
* to CH_UTF8 replaces invalid values (see utf16_munged_pull()).
*
@@ -273,7 +273,7 @@ _PUBLIC_ char *rfc1738_unescape(char *buf);
_PUBLIC_ char *rfc1738_escape_part(TALLOC_CTX *mem_ctx, const char *url);
/**
- varient of strcmp() that handles NULL ptrs
+ variant of strcmp() that handles NULL ptrs
**/
_PUBLIC_ int strcmp_safe(const char *s1, const char *s2);
@@ -321,7 +321,7 @@ _PUBLIC_ bool conv_str_u64(const char * str, uint64_t * val);
*
* @param[in] s2 The second memory region to compare.
*
- * @param[in] n The length of the memory to comapre.
+ * @param[in] n The length of the memory to compare.
*
* @return true when the memory regions are equal, false if not.
*/
diff --git a/lib/util/smb_strtox.c b/lib/util/smb_strtox.c
index e57316e29b5..7a477dc8aaa 100644
--- a/lib/util/smb_strtox.c
+++ b/lib/util/smb_strtox.c
@@ -30,7 +30,7 @@
* @param nptr pointer to string which is to be converted
* @param endptr [optional] reference to remainder of the string
* @param base base of the numbering scheme
- * @param err error occured during conversion
+ * @param err error occurred during conversion
* @flags controlling conversion feature
* @result result of the conversion as provided by strtoul
*
@@ -106,7 +106,7 @@ out:
* @param nptr pointer to string which is to be converted
* @param endptr [optional] reference to remainder of the string
* @param base base of the numbering scheme
- * @param err error occured during conversion
+ * @param err error occurred during conversion
* @flags controlling conversion feature
* @result result of the conversion as provided by strtoull
*
diff --git a/lib/util/string_wrappers.h b/lib/util/string_wrappers.h
index 00bce079fbf..7625cd076ea 100644
--- a/lib/util/string_wrappers.h
+++ b/lib/util/string_wrappers.h
@@ -54,7 +54,7 @@ do { \
#ifdef HAVE_COMPILER_WILL_OPTIMIZE_OUT_FNS
/* We need a number of different prototypes for our
- non-existent fuctions */
+ non-existent functions */
char * __unsafe_string_function_usage_here__(void);
size_t __unsafe_string_function_usage_here_size_t__(void);
diff --git a/lib/util/tests/asn1_tests.c b/lib/util/tests/asn1_tests.c
index ab5262c4ffb..f2bd163c428 100644
--- a/lib/util/tests/asn1_tests.c
+++ b/lib/util/tests/asn1_tests.c
@@ -75,7 +75,7 @@ static const char *oid_data_err[] = {
"2..5.4.130", /* second sub-identifier is empty */
"2.5..4.130", /* third sub-identifier is empty */
"2.abc.4.130", /* invalid sub-identifier */
- "2.5abc.4.130", /* invalid sub-identifier (alpha-numeric)*/
+ "2.5abc.4.130", /* invalid sub-identifier (alphanumeric)*/
};
/* Data for successful Partial OIDs conversions */
diff --git a/lib/util/tests/rfc1738.c b/lib/util/tests/rfc1738.c
index 6e960377964..4f7eced9499 100644
--- a/lib/util/tests/rfc1738.c
+++ b/lib/util/tests/rfc1738.c
@@ -16,7 +16,7 @@
and its supposedly escaped equivalent.
The first part of the flag name indicates the direction of transformation;
- tyhe second part is the expected result. For example, ESCAPE_EQ means the
+ the second part is the expected result. For example, ESCAPE_EQ means the
escape is expected to succeed and result is expected to be equal to the
given answer. ESCAPE_EQ_CASECMP is only equal when compared
case-insensitively. UNESCAPE_ERR means unescaping the escaped string should
diff --git a/lib/util/tfork.c b/lib/util/tfork.c
index e3eaa199db5..316287b1284 100644
--- a/lib/util/tfork.c
+++ b/lib/util/tfork.c
@@ -103,7 +103,7 @@ struct tfork_state {
/*
* A global state that synchronizes access to handling SIGCHLD and waiting for
- * childs.
+ * children.
*/
struct tfork_signal_state {
bool available;
@@ -677,7 +677,7 @@ static pid_t tfork_start_waiter_and_worker(struct tfork_state *state,
_exit(errno);
}
/*
- * The caller exitted and didn't call tfork_status().
+ * The caller exited and didn't call tfork_status().
*/
_exit(0);
}
@@ -699,7 +699,7 @@ static pid_t tfork_start_waiter_and_worker(struct tfork_state *state,
* Wait for our parent (the process that called tfork_create()) to
* close() the socketpair fd in tfork_status().
*
- * Again, the caller might have exitted without calling tfork_status().
+ * Again, the caller might have exited without calling tfork_status().
*/
nread = sys_read(status_sp_waiter_fd, &c, 1);
if (nread == -1) {
diff --git a/lib/util/tfork.h b/lib/util/tfork.h
index 7b2ecd1eb89..6c59caf56c5 100644
--- a/lib/util/tfork.h
+++ b/lib/util/tfork.h
@@ -46,7 +46,7 @@ struct tfork;
* @note There's one thing this thing can't protect us against and that is if a
* process installs a SIGCHLD handler from one thread while another thread is
* running inside tfork_create() or tfork_status() and the signal handler
- * doesn't forward signals for exitted childs it didn't fork, ie our childs.
+ * doesn't forward signals for exited children it didn't fork, ie our children.
**/
struct tfork *tfork_create(void);
diff --git a/lib/util/time.c b/lib/util/time.c
index 773fd611a33..c2a77d664d3 100644
--- a/lib/util/time.c
+++ b/lib/util/time.c
@@ -1166,7 +1166,7 @@ struct timespec nt_time_to_full_timespec(NTTIME nt)
* Note: this function uses the full time_t range as valid date values including
* (time_t)0 and -1. That means that struct timespec sentinel values (cf
* is_omit_timespec()) can't be converted to sentinel values in a time_t
- * representation. Callers should therefor check the NTTIME value with
+ * representation. Callers should therefore check the NTTIME value with
* null_nttime() before calling this function.
**/
time_t full_timespec_to_time_t(const struct timespec *_ts)
@@ -1204,7 +1204,7 @@ time_t full_timespec_to_time_t(const struct timespec *_ts)
* Note: this function uses the full time_t range as valid date values including
* (time_t)0 and -1. That means that NTTIME sentinel values of 0 and -1 which
* represent a "not-set" value, can't be converted to sentinel values in a
- * time_t representation. Callers should therefor check the NTTIME value with
+ * time_t representation. Callers should therefore check the NTTIME value with
* null_nttime() before calling this function.
**/
time_t nt_time_to_full_time_t(NTTIME nt)
diff --git a/lib/util/util.c b/lib/util/util.c
index faa4218d19f..b35ba115a7a 100644
--- a/lib/util/util.c
+++ b/lib/util/util.c
@@ -1086,7 +1086,7 @@ _PUBLIC_ char *hex_encode_talloc(TALLOC_CTX *mem_ctx, const unsigned char *buff_
}
/**
- varient of strcmp() that handles NULL ptrs
+ variant of strcmp() that handles NULL ptrs
**/
_PUBLIC_ int strcmp_safe(const char *s1, const char *s2)
{