0
0
Fork 0
mirror of https://github.com/schollz/croc.git synced 2025-10-11 13:21:00 +02:00

print bytes

This commit is contained in:
Zack 2024-07-25 08:41:48 -07:00
parent 4f1a6a8d4f
commit 8f226f72b6

View file

@ -575,11 +575,11 @@ func ValidFileName(fname string) (err error) {
// make sure it doesn't contain unicode or invisible characters // make sure it doesn't contain unicode or invisible characters
for _, r := range fname { for _, r := range fname {
if !unicode.IsGraphic(r) { if !unicode.IsGraphic(r) {
err = fmt.Errorf("non-graphical unicode: %x U+%d in '%s'", string(r), r, fname) err = fmt.Errorf("non-graphical unicode: %x U+%d in '%x'", string(r), r, fname)
return return
} }
if !unicode.IsPrint(r) { if !unicode.IsPrint(r) {
err = fmt.Errorf("non-printable unicode: %x U+%d in '%s'", string(r), r, fname) err = fmt.Errorf("non-printable unicode: %x U+%d in '%x'", string(r), r, fname)
return return
} }
} }