Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 11 Jul 2001 11:49:17 +0200 (CEST)
From:      matthias.andree@web.de
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   misc/28890: update to mergesort/merge.c: match i and size types.
Message-ID:  <20010711094917.B4B462D310@freebsd.emma.line.org>

next in thread | raw e-mail | index | archive | help

>Number:         28890
>Category:       misc
>Synopsis:       merge.c compares int i against size_t size
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jul 11 02:50:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator:     Matthias Andree
>Release:        FreeBSD 4.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD freebsd.emma.line.org 4.3-RELEASE FreeBSD 4.3-RELEASE #5: Tue Jul 10 17:12:16 CEST 2001 root@freebsd.emma.line.org:/usr/src/sys/compile/M2A2 i386


	
>Description:
/usr/src/lib/libc/stdlib/merge.c compares i against size at lines 169
and 182.

i is of type int and size of type size_t, their signedness doesn't
match.
	
>How-To-Repeat:
run merge.c through gcc with -W -Wall
	
>Fix:
Apply this patch:

*** merge.c.old	Wed Jul 11 11:47:20 2001
--- merge.c	Wed Jul 11 11:47:43 2001
***************
*** 101,107 ****
  	register size_t size;
  	int (*cmp) __P((const void *, const void *));
  {
! 	register int i, sense;
  	int big, iflag;
  	register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
  	u_char *list2, *list1, *p2, *p, *last, **p1;
--- 101,108 ----
  	register size_t size;
  	int (*cmp) __P((const void *, const void *));
  {
! 	register size_t i;
! 	register int sense;
  	int big, iflag;
  	register u_char *f1, *f2, *t, *b, *tp2, *q, *l1, *l2;
  	u_char *list2, *list1, *p2, *p, *last, **p1;
	
>Release-Note:
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010711094917.B4B462D310>