aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-09-05 14:20:55 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-09-05 14:20:55 +0200
commit472a74b75b598e38856d8f8ad9e71f355b7538c6 (patch)
tree9c5a6baee45abbbc884c52956335ef9df34ce020
parent3167a7a2d35173414fa1b333db4908ac140c1c4d (diff)
downloadmblaze-472a74b75b598e38856d8f8ad9e71f355b7538c6.tar.gz
use getdelim instead of getline
Avoids weird macros to build on FreeBSD.
-rw-r--r--mdeliver.c4
-rw-r--r--mexport.c2
-rw-r--r--mmime.c2
-rw-r--r--mseq.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/mdeliver.c b/mdeliver.c
index c8cef61..4cee5e4 100644
--- a/mdeliver.c
+++ b/mdeliver.c
@@ -60,7 +60,7 @@ deliver(FILE *infile)
// skip to first "From " line
while (1) {
errno = 0;
- ssize_t rd = getline(&line, &linelen, infile);
+ ssize_t rd = getdelim(&line, &linelen, '\n', infile);
if (rd == -1) {
if (errno == 0)
// invalid mbox file
@@ -98,7 +98,7 @@ tryagain:
int is_old = 0;
while (1) {
errno = 0;
- ssize_t rd = getline(&line, &linelen, infile);
+ ssize_t rd = getdelim(&line, &linelen, '\n', infile);
if (rd == -1) {
if (errno != 0)
return -1;
diff --git a/mexport.c b/mexport.c
index 2e06890..7c31609 100644
--- a/mexport.c
+++ b/mexport.c
@@ -62,7 +62,7 @@ export(char *file)
while (1) {
errno = 0;
- ssize_t rd = getline(&line, &linelen, infile);
+ ssize_t rd = getdelim(&line, &linelen, '\n', infile);
if (rd == -1) {
if (errno == 0)
break;
diff --git a/mmime.c b/mmime.c
index d6897a8..788f4bf 100644
--- a/mmime.c
+++ b/mmime.c
@@ -273,7 +273,7 @@ gen_build()
int intext = 0;
while (1) {
- int read = getline(&line, &linelen, stdin);
+ int read = getdelim(&line, &linelen, '\n', stdin);
if (read == -1) {
if (feof(stdin))
break;
diff --git a/mseq.c b/mseq.c
index 70ed1b2..00ec844 100644
--- a/mseq.c
+++ b/mseq.c
@@ -205,7 +205,7 @@ stdinmode()
outfile = stdout;
}
- while ((rd = getline(&line, &linelen, stdin)) != -1) {
+ while ((rd = getdelim(&line, &linelen, '\n', stdin)) != -1) {
if (line[rd-1] == '\n')
line[rd-1] = 0;