summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-03-07 05:09:23 +0000
committerJim Meyering <jim@meyering.net>1999-03-07 05:09:23 +0000
commit3a01605b6b993446d54c20ce57df8f49e8b7bbb4 (patch)
tree44d000b6a2bd28245bac40535886a3d353cb2191 /src
parent13106e125bfcd283f1c9fe22f413ca0035e471ae (diff)
downloadcoreutils-3a01605b6b993446d54c20ce57df8f49e8b7bbb4.tar.xz
(getstr): Change type of `delim' parameter from char to int.
(cut_fields): Cast to `unsigned char' before comparing. (main): Cast to `unsigned char' before assigning.
Diffstat (limited to 'src')
-rw-r--r--src/cut.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cut.c b/src/cut.c
index 2523789d1..9a1d685b9 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -238,7 +238,7 @@ With no FILE, or when FILE is -, read standard input.\n\
including the null terminator), or -1 on error or EOF. */
static int
-getstr (char **lineptr, int *n, FILE *stream, char terminator)
+getstr (char **lineptr, int *n, FILE *stream, int terminator)
{
int nchars_avail; /* Allocated but unused chars in *LINEPTR. */
char *read_pos; /* Where we're reading into *LINEPTR. */
@@ -555,7 +555,7 @@ cut_fields (FILE *stream)
/* If the first field extends to the end of line (it is not
delimited) and we are printing all non-delimited lines,
print this one. */
- if (field_1_buffer[len - 1] != delim)
+ if ((unsigned char) field_1_buffer[len - 1] != delim)
{
if (suppress_non_delimited)
{
@@ -731,7 +731,7 @@ main (int argc, char **argv)
/* Interpret -d '' to mean `use the NUL byte as the delimiter.' */
if (optarg[0] != '\0' && optarg[1] != '\0')
FATAL_ERROR (_("the delimiter must be a single character"));
- delim = optarg[0];
+ delim = (unsigned char) optarg[0];
delim_specified = 1;
break;