summaryrefslogtreecommitdiffstats
path: root/common/readline.c
diff options
context:
space:
mode:
authorLibravatar Ryan Dwyer <RyanDwyer@users.noreply.github.com>2018-09-21 20:05:39 +1000
committerLibravatar GitHub <noreply@github.com>2018-09-21 20:05:39 +1000
commit0798fadff2f2f74a7efd7c14c55737bac19de954 (patch)
tree86e1ab4983fec3586a8bbb0044216216e22cc1cb /common/readline.c
parentFix segfault in output_render (diff)
parentMerge pull request #2671 from emersion/output-execute-no-focus (diff)
downloadsway-0798fadff2f2f74a7efd7c14c55737bac19de954.tar.gz
sway-0798fadff2f2f74a7efd7c14c55737bac19de954.tar.zst
sway-0798fadff2f2f74a7efd7c14c55737bac19de954.zip
Merge branch 'master' into render-output-segfault
Diffstat (limited to 'common/readline.c')
-rw-r--r--common/readline.c25
1 files changed, 0 insertions, 25 deletions
diff --git a/common/readline.c b/common/readline.c
index a2c69018..58652429 100644
--- a/common/readline.c
+++ b/common/readline.c
@@ -70,28 +70,3 @@ char *peek_line(FILE *file, int line_offset, long *position) {
70 fseek(file, pos, SEEK_SET); 70 fseek(file, pos, SEEK_SET);
71 return line; 71 return line;
72} 72}
73
74char *read_line_buffer(FILE *file, char *string, size_t string_len) {
75 size_t length = 0;
76 if (!string) {
77 return NULL;
78 }
79 while (1) {
80 int c = getc(file);
81 if (c == EOF || c == '\n' || c == '\0') {
82 break;
83 }
84 if (c == '\r') {
85 continue;
86 }
87 string[length++] = c;
88 if (string_len <= length) {
89 return NULL;
90 }
91 }
92 if (length + 1 == string_len) {
93 return NULL;
94 }
95 string[length] = '\0';
96 return string;
97}