antirez / antirez/kilo

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

Đang mở
#39 2 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
C
Star
9.1k
Fork
995
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.