Re: [PATCH] text-utils: minor fixes to magic() | |
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] | |
On Wed, May 14, 2008 at 09:51:40AM +0100, James Youngman wrote:
> Read the magic bytes into signed chars instead of vanilla chars in
> order to ensure consistent results even on systems whose char type has
> no sign. Eliminate spurious parentheses in return statements.
> Correct grammatical errors in comments.
>
> Signed-off-by: James Youngman <jay@xxxxxxx>
> ---
> text-utils/more.c | 10 +++++-----
> 1 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/text-utils/more.c b/text-utils/more.c
> index dc38ff2..f251b27 100644
> --- a/text-utils/more.c
> +++ b/text-utils/more.c
> @@ -531,18 +531,18 @@ checkf (fs, clearfirst)
> /*
> * magic --
> * check for file magic numbers. This code would best be shared with
> - * the file(1) program or, perhaps, more should not try and be so smart?
> + * the file(1) program or, perhaps, more should not try to be so smart.
> */
> static int
> magic(f, fs)
> FILE *f;
> char *fs;
> {
> - char twobytes[2];
> + signed char twobytes[2];
Please, see make(1) output during util-linux compilation. We use the
"-fsigned-char" gcc option to avoid problems with ambiguous "char".
Karel
--
Karel Zak <kzak@xxxxxxxxxx>
--
To unsubscribe from this list: send the line "unsubscribe util-linux-ng" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Site Home] [Netdev] [Ethernet Bridging] [Linux Wireless] [Kernel Newbies] [Memory] [Security] [Linux for Hams] [Netfilter] [Bugtraq] [Rubini] [Photo] [Yosemite] [Yosemite News] [MIPS Linux] [ARM Linux] [Linux RAID] [Linux Admin] [Samba] [Video 4 Linux] [Linux Resources]