2
3
Fork
You've already forked ncsu
0

Fix incorrect format string causing invalid export files #209

Closed
tobbez wants to merge 0 commits from fix-format-string-fill into zig
pull from: fix-format-string-fill
merge into: selfisekai:zig
selfisekai:zig
selfisekai:zig0.16
selfisekai:master
selfisekai:zig-threaded
selfisekai:openat
selfisekai:chdir
selfisekai:clear
selfisekai:compll
tobbez commented 2022年10月15日 21:01:50 +02:00 (Migrated from code.blicky.net)
Copy link

Zig requires alignment to be specified when specifying a fill character,
as otherwise digits specified after ':' are interpreted as part of the
field width.

The missing alignment specifier caused character codes < 0x10 to be
serialized incorrectly, producing an export file ncdu could not import.

For example, a character with code 1 would be serialized as '\u00 1'
instead of '\u0001'.

A directory of test files can be generated using:

mkdir test_files; i=1; while [ $i -le 255 ]; do c="$(printf "$(printf "\\\\x%02xZ" "$i")")"; c="${c%Z}"; touch "test_files/$c"; i=$((i+1)); done
Zig requires alignment to be specified when specifying a fill character, as otherwise digits specified after ':' are interpreted as part of the field width. The missing alignment specifier caused character codes < 0x10 to be serialized incorrectly, producing an export file ncdu could not import. For example, a character with code 1 would be serialized as '\u00 1' instead of '\u0001'. A directory of test files can be generated using: mkdir test_files; i=1; while [ $i -le 255 ]; do c="$(printf "$(printf "\\\\x%02xZ" "$i")")"; c="${c%Z}"; touch "test_files/$c"; i=$((i+1)); done
yorhel commented 2022年10月16日 08:34:45 +02:00 (Migrated from code.blicky.net)
Copy link

Pulled, thanks!

Pulled, thanks!

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No reviewers
No labels
1.x
2.x
bug
feature
imported
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
selfisekai/ncsu!209
Reference in a new issue
selfisekai/ncsu
No description provided.
Delete branch "fix-format-string-fill"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?