/* 0 if `separator' is to be matched as a regular expression;
otherwise, the length of `separator', used as a sentinel to
stop the search. */
-static int sentinel_length;
+static size_t sentinel_length;
/* The length of a match with `separator'. If `sentinel_length' is 0,
`match_length' is computed every time a match succeeds;
static char *tempdir;
char *tempfile;
FILE *tmp;
- ssize_t bytes_read;
int fd;
if (template == NULL)
while (1)
{
- bytes_read = safe_read (STDIN_FILENO, G_buffer, read_size);
+ size_t bytes_read = safe_read (STDIN_FILENO, G_buffer, read_size);
if (bytes_read == 0)
break;
- if (bytes_read < 0)
+ if (bytes_read == SAFE_READ_ERROR)
error (EXIT_FAILURE, errno, _("stdin: read error"));
if (fwrite (G_buffer, 1, bytes_read, tmp) != bytes_read)
while (1)
{
- ssize_t bytes_read;
+ size_t bytes_read;
if (buf == NULL)
buf = (char *) malloc (bufsiz);
else
bytes_read = safe_read (STDIN_FILENO, buf + n_bytes, bufsiz - n_bytes);
if (bytes_read == 0)
break;
- if (bytes_read < 0)
+ if (bytes_read == SAFE_READ_ERROR)
error (EXIT_FAILURE, errno, _("stdin: read error"));
n_bytes += bytes_read;