davidcallanan / os-series

819 stars 120 forks source link

Update print.c #15

Closed itopaloglu83 closed 1 year ago

itopaloglu83 commented 3 years ago

Off by one bug. Printing a new line when col > NUM_COLS prints 81 characters on a single line.

davidcallanan commented 3 years ago

Are you sure?

When attempting to print the 81th character, the if statement succeeds. This then results in printing a newline. The character finally gets printed as the first character of the new line.

EDIT: Nevermind, arrays are zero-indexed, so yes I think you are right. Thank you for noticing this! I will merge soon.

halotroop2288 commented 1 year ago

RIP this fix.