threads / patch / 47536

patchutf8.c: mark utf{16,32}_{be,le}_bom symbols static

Subject: [PATCH] utf8.c: mark utf{16,32}_{be,le}_bom symbols static

## tl;dr

One message between Jan 4, 2018 and Jan 4, 2018. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Ramsay Jones· Jan 4, 2018, 17:20 UTC · lore
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
---
Hi Lars,

If you need to re-roll your 'ls/checkout-encoding' branch, could you please squash this into the relevant patch (commit d5318db2d0, "utf8: add function to detect prohibited UTF-16/32 BOM", 2017-12-31).

[yes, noticed by sparse].
Thanks!

ATB, Ramsay Jones

 utf8.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
Show changes to utf8.c +4 −4
diff --git a/utf8.c b/utf8.c
index 1978d6c42..f033fec1c 100644
--- a/utf8.c
+++ b/utf8.c
@@ -544,10 +544,10 @@ static int has_bom_prefix(const char *data, size_t len,
 	return (len >= bom_len) && !memcmp(data, bom, bom_len);
 }
 
-const char utf16_be_bom[] = {0xFE, 0xFF};
-const char utf16_le_bom[] = {0xFF, 0xFE};
-const char utf32_be_bom[] = {0x00, 0x00, 0xFE, 0xFF};
-const char utf32_le_bom[] = {0xFF, 0xFE, 0x00, 0x00};
+static const char utf16_be_bom[] = {0xFE, 0xFF};
+static const char utf16_le_bom[] = {0xFF, 0xFE};
+static const char utf32_be_bom[] = {0x00, 0x00, 0xFE, 0xFF};
+static const char utf32_le_bom[] = {0xFF, 0xFE, 0x00, 0x00};
 
 int has_prohibited_utf_bom(const char *enc, const char *data, size_t len)
 {
-- 
2.15.0

← back to recent threads