Skip to content

Conversation

@Dwyriel
Copy link

@Dwyriel Dwyriel commented Sep 10, 2025

Saves the value of pointer a to a temp t instead of the pointer itself, then puts that back into b.

Explanation:
The swap function was saving the pointer a to a temporary pointer t, then changing the value pointed by a (and thus also t) to the value pointed by b, then putting the value pointed by the temporary value t (which became the content of b after *a = *b since both t and a were the same pointer) resulting in both a and b having the same value (of b).
This would cause the function ssd1306_draw_line to only render a single dot at (x2, y2) if x1 was greater than x2 or (x1,y2) if x1 was equal to x2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant