busybox: make high ASCII chars printable (#7993)
[openwrt.git] / package / utils / busybox / patches / 270-libbb_make_unicode_printable.patch
diff --git a/package/utils/busybox/patches/270-libbb_make_unicode_printable.patch b/package/utils/busybox/patches/270-libbb_make_unicode_printable.patch
new file mode 100644 (file)
index 0000000..3bfd48a
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/libbb/printable_string.c
++++ b/libbb/printable_string.c
+@@ -31,8 +31,6 @@ const char* FAST_FUNC printable_string(u
+               }
+               if (c < ' ')
+                       break;
+-              if (c >= 0x7f)
+-                      break;
+               s++;
+       }
+@@ -45,7 +43,7 @@ const char* FAST_FUNC printable_string(u
+                       unsigned char c = *d;
+                       if (c == '\0')
+                               break;
+-                      if (c < ' ' || c >= 0x7f)
++                      if (c < ' ')
+                               *d = '?';
+                       d++;
+               }