Browse Source

Fix null terminator in getline()

master
Nathaniel Walizer 10 months ago
parent
commit
719f51aa12
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      src/compat.c

+ 1
- 1
src/compat.c View File

@@ -45,7 +45,7 @@ ssize_t getline(char **restrict lineptr, size_t *restrict n,
if ('\n' == chr) break; if ('\n' == chr) break;
} }


ptr[len] = '\0';
*ptr = '\0';


return (len == 0 ? -1 : len); return (len == 0 ? -1 : len);
} }


Loading…
Cancel
Save