OSDN Git Service
(root)
/
android-x86
/
external-parted.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9f8b683
)
Don't write into line[-1] when line starts with a NUL byte.
author
Jim Meyering
<meyering@redhat.com>
Mon, 4 Feb 2008 07:35:17 +0000
(08:35 +0100)
committer
Jim Meyering
<meyering@redhat.com>
Mon, 4 Feb 2008 07:35:17 +0000
(08:35 +0100)
* parted/ui.c (_readline): Check strlen first.
parted/ui.c
patch
|
blob
|
history
diff --git
a/parted/ui.c
b/parted/ui.c
index
370c2be
..
d9ab107
100644
(file)
--- a/
parted/ui.c
+++ b/
parted/ui.c
@@
-572,7
+572,9
@@
_readline (const char* prompt, const StrList* possibilities)
fputs (line, stdout);
fflush (stdout);
#endif
- line [strlen (line) - 1] = 0; /* kill trailing CR */
+ /* kill trailing NL */
+ if (strlen (line))
+ line [strlen (line) - 1] = 0;
} else {
free (line);
line = NULL;