diff options
author | Jim Meyering <jim@meyering.net> | 2002-10-12 09:44:06 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2002-10-12 09:44:06 +0000 |
commit | b7fbfec375f1d9a70467ebe2f334fb23a13a2fc0 (patch) | |
tree | 3ca433c3045a8264f521ffb493f2a91cbfab8efb | |
parent | 0b7a5a2391e1f61a71e995b583f3229d0b4fa6d0 (diff) | |
download | coreutils-b7fbfec375f1d9a70467ebe2f334fb23a13a2fc0.tar.xz |
(struct cstring) [len]: Declare to be unsigned int,
since that's how it's always used and avoids a new warning from gcc.
(read_input): Adapt to new safe_read ABI.
-rw-r--r-- | src/csplit.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/csplit.c b/src/csplit.c index 2b8649e0b..2d741d81e 100644 --- a/src/csplit.c +++ b/src/csplit.c @@ -85,7 +85,7 @@ struct control /* A string with a length count. */ struct cstring { - int len; + unsigned int len; char *str; }; @@ -267,11 +267,14 @@ save_to_hold_area (char *start, unsigned int num) /* Read up to MAX_N_BYTES chars from the input stream into DEST. Return the number of chars read. */ +/* FIXME: MAX_N_BYTES should be of type size_t, but if you pull + that thread, you'll find there are many other `unsigned' types + in this file that should also be changed. */ -static int -read_input (char *dest, unsigned int max_n_bytes) +static size_t +read_input (char *dest, int max_n_bytes) { - int bytes_read; + size_t bytes_read; if (max_n_bytes == 0) return 0; @@ -281,7 +284,7 @@ read_input (char *dest, unsigned int max_n_bytes) if (bytes_read == 0) have_read_eof = TRUE; - if (bytes_read < 0) + if (bytes_read == SAFE_READ_ERROR) { error (0, errno, _("read error")); cleanup_fatal (); |