X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fsource-file.cc;h=041c046d2bfc2fa4761df56005f2e76692f962f7;hb=f581e0199e1d303c18aa86650350b4678313a461;hp=b42fb7a5b37a508f69ce8d31925ae9478e7972c4;hpb=4a401ca1c60f428daa242dbdd102fdb3f327ebfb;p=lilypond.git diff --git a/lily/source-file.cc b/lily/source-file.cc index b42fb7a5b3..041c046d2b 100644 --- a/lily/source-file.cc +++ b/lily/source-file.cc @@ -261,7 +261,11 @@ Source_file::get_counts (char const *pos_str0, int *column, int *byte_offset) const { + // Initialize arguments to defaults, needed if pos_str0 is not in source *line_number = 0; + *line_char = 0; + *column = 0; + *byte_offset = 0; if (!contains (pos_str0)) return; @@ -276,10 +280,6 @@ Source_file::get_counts (char const *pos_str0, string line_begin (line_start, left); char const *line_chars = line_begin.c_str (); - *line_char = 0; - *column = 0; - *byte_offset = 0; - while (left > 0) { size_t thislen = utf8_char_len (*line_chars);