OSDN Git Service
(root)
/
android-x86
/
external-toybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e5fb6a2
)
Bugfix from Hyejin Kim (count=1 shouldn't change name), plus a bounds check.
author
Rob Landley
<rob@landley.net>
Tue, 21 Apr 2015 06:45:07 +0000
(
01:45
-0500)
committer
Rob Landley
<rob@landley.net>
Tue, 21 Apr 2015 06:45:07 +0000
(
01:45
-0500)
Test is 'echo "AAA c 1 0 0 2 5 0 0 1" | makedevs' makes AAA not AAA0.
toys/other/makedevs.c
patch
|
blob
|
history
diff --git
a/toys/other/makedevs.c
b/toys/other/makedevs.c
index
0d20a57
..
0f0a661
100644
(file)
--- a/
toys/other/makedevs.c
+++ b/
toys/other/makedevs.c
@@
-84,8
+84,8
@@
void makedevs_main()
while (*node == '/') node++; // using relative path
for (i = 0; (!cnt && !i) || i < cnt; i++) {
- if (cnt) {
- snprintf(toybuf, sizeof(toybuf), "%s%u", node, st_val + i);
+ if (cnt
>1
) {
+ snprintf(toybuf, sizeof(toybuf), "%
.999
s%u", node, st_val + i);
ptr = toybuf;
} else ptr = node;