summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2000-08-21 08:54:19 +0000
committerBruno Haible <bruno@clisp.org>2000-08-21 08:54:19 +0000
commitd22dd3f6e621f9b774bd04ac23c05cac1291fc88 (patch)
tree50d8b7085d0b03c3355393d7be5820dbd5891948
parent8df0d1ea8731e765583a623d9836fcaded487652 (diff)
downloadgperf-d22dd3f6e621f9b774bd04ac23c05cac1291fc88.tar.gz
No need any more to NUL terminate keys.
-rw-r--r--src/key-list.cc10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/key-list.cc b/src/key-list.cc
index 157458c..697e784 100644
--- a/src/key-list.cc
+++ b/src/key-list.cc
@@ -213,7 +213,7 @@ Key_List::set_output_types (void)
/* Extracts a key from an input line and creates a new List_Node for it. */
static List_Node *
-parse_line (char *line, const char *delimiters)
+parse_line (const char *line, const char *delimiters)
{
if (*line == '"')
{
@@ -342,12 +342,8 @@ parse_line (char *line, const char *delimiters)
if (line[len] == '\0')
rest = "";
else
- {
- /* Quick hack to separate the key from the rest, killing the first
- delimiter. */
- line[len] = '\0';
- rest = &line[len + 1];
- }
+ /* Skip the first delimiter. */
+ rest = &line[len + 1];
return new List_Node (line, len, option[TYPE] ? rest : "");
}
}