This website works better with JavaScript.
Home
Explore
Help
Sign In
Immanuel
/
nnn
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
realloc() behaves like free() if size is 0
master
sin
10 years ago
parent
644dd348d6
commit
8d018e620f
1 changed files
with
2 additions
and
2 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+2
-2
noice.c
+ 2
- 2
noice.c
View File
@@ -366,9 +366,9 @@ readln(void)
if (c == KEY_BACKSPACE) {
getyx(stdscr, y, x);
if (x >= x0) {
i--;
if (i > 0) {
ln = xrealloc(ln, (i - 1) * sizeof(*ln));
i--;
ln = xrealloc(ln, i * sizeof(*ln));
} else {
free(ln);
ln = NULL;
Write
Preview
Loading…
Cancel
Save