antirez / antirez/kilo

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

Offen
#39 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
9.1k
Forks
995
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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);

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.