diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-10-12 14:19:59 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-10-12 14:19:59 -0400 |
| commit | 6e5fb2ac4e5b780c74f310446ddd80d571170b0d (patch) | |
| tree | 587241a69065c01b890d7ae70a37af08bba646b1 /src/stdlib/stacktrace.c | |
| parent | 3cd3b20f58e9d2c6463d503be09e5d4cfaadee6c (diff) | |
More code cleanups
Diffstat (limited to 'src/stdlib/stacktrace.c')
| -rw-r--r-- | src/stdlib/stacktrace.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdlib/stacktrace.c b/src/stdlib/stacktrace.c index 0953e660..b21d0cbc 100644 --- a/src/stdlib/stacktrace.c +++ b/src/stdlib/stacktrace.c @@ -34,7 +34,7 @@ static void fprint_context(FILE *out, const char *filename, int lineno, int cont num_width += 1; while ((nread = getline(&line, &size, f)) != -1) { - if (line[strlen(line) - 1] == '\n') line[strlen(line) - 1] = '\0'; + if (line[nread - 1] == '\n') line[nread - 1] = '\0'; if (cur_line >= lineno - context_before) { int w = 1; |
