Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Why kilo allocating 9 bytes memory for a non-printable character? #39

Open
KiYugadgeter opened this issue Sep 22, 2016 · 2 comments

Comments

@KiYugadgeter
Copy link

KiYugadgeter commented Sep 22, 2016

I am reading kilo code for learning C language.
In line551, allocating 9 bytes memory for one non-printable character.
Why 9 bytes memory need for a non-printable character?

And nonprint variable is only initialized to 0 at line 543, and it is not assigned to other value.
So I think nonprint is not useful at line 551.
What's the meaning of this?


row->render = malloc(row->size + tabs*8 + nonprint*9 + 1);

@h4child
Copy link

h4child commented Jan 18, 2017

I don't know!
But this already been removed https://github.com/practicalswift/openemacs/commit/469aadcb984ab693fe4a3cf9925790d0cf621f66 FORK

@dirkf
Copy link

dirkf commented Dec 21, 2020

The author probably intended to display non-printing characters something like <CTRL-D>. However ? is actually meant to be used, so the correct width is 1.

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

No branches or pull requests

3 participants