aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-11-30 17:23:46 +0000
committerRoger Dingledine <arma@torproject.org>2007-11-30 17:23:46 +0000
commit188cb920d01349b256a49bd96b7e26c09c2d54af (patch)
treedbcd8be48ed7ee6beefb0c5c6d8b8a540cd421df
parente9b999ff2282d1cd9aea6c62ee39573479a0c5bb (diff)
downloadtor-188cb920d01349b256a49bd96b7e26c09c2d54af.tar
tor-188cb920d01349b256a49bd96b7e26c09c2d54af.tar.gz
cleanups while i was trying to figure out how it worked
svn:r12612
-rw-r--r--src/common/util.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/common/util.c b/src/common/util.c
index 8ee64f452..87f6aa5f1 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1889,8 +1889,8 @@ read_file_to_str(const char *filename, int flags, struct stat *stat_out)
* the start of the next line. If we run out of data, return a pointer to the
* end of the string. If we encounter an error, return NULL.
*
- * NOTE: We modify <b>line</b> as we parse it, by inserting NULs to terminate
- * the key and value.
+ * NOTE: We modify *<b>line</b> as we parse it, by inserting NULs
+ * to terminate the key and value.
*/
char *
parse_line_from_str(char *line, char **key_out, char **value_out)
@@ -1923,9 +1923,10 @@ parse_line_from_str(char *line, char **key_out, char **value_out)
while (*line && !TOR_ISSPACE(*line) && *line != '#')
++line;
- /* Skip until the value */
+ /* Skip until the value, writing nuls so key will be nul-terminated */
while (*line == ' ' || *line == '\t')
*line++ = '\0';
+
val = line;
/* Find the end of the line. */