/* Ported from glibc by Simon Josefsson. */
-#include <config.h>
+#include "compat.h"
#include <stdio.h>
ssize_t
getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp)
{
- ssize_t result;
+ ssize_t result = -1;
size_t cur_len = 0;
if (lineptr == NULL || n == NULL || fp == NULL)
break;
}
(*lineptr)[cur_len] = '\0';
- result = cur_len ? cur_len : result;
+ result = cur_len ? (ssize_t) cur_len : result;
unlock_return:
funlockfile (fp); /* doesn't set errno */