Skip to content

Commit

Permalink
backtrace: fix skipped number of traces
Browse files Browse the repository at this point in the history
  • Loading branch information
rasky committed Oct 14, 2024
1 parent 09160b0 commit ccfa1e3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/backtrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,7 +620,7 @@ static void backtrace_foreach(void (*cb)(void *arg, void *ptr), void *arg, uint3

int backtrace(void **buffer, int size)
{
int i = -2; // skip backtrace_foreach() and backtrace())
int i = -1; // Skip backtrace() itself
void cb(void *arg, void *ptr) {
if (i >= size) return;
if (i >= 0)
Expand Down

0 comments on commit ccfa1e3

Please sign in to comment.