Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jan 2008 23:31:29 +0100 (CET)
From:      "Julian H. Stacey" <jhs@berklix.org>
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        "Julian H. Stacey" <jhs@berklix.com>
Subject:   bin/119610: config -x appends unwanted trailing null, patched
Message-ID:  <200801122231.m0CMVTUU001521@lapd.js.berklix.net>
Resent-Message-ID: <200801122240.m0CMe1hA085074@freefall.freebsd.org>

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

>Number:         119610
>Category:       bin
>Synopsis:       config -x appends unwanted trailing null, patched
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jan 12 22:40:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Julian H. Stacey <jhs@berklix.com>
>Release:        FreeBSD 7.0-PRERELEASE i386
>Organization:
http://berklix.com
>Environment:
System: FreeBSD lapd.js.berklix.net 7.0-PRERELEASE FreeBSD 7.0-PRERELEASE #82: Sat Jan 12 13:14:16 CET 2008 jhs@lapd.js.berklix.net:/usr/src/sys/i386/compile/LAPD.small i386


	
>Description:
	config -x appends unwanted trailing null
	avoid it, as it upsets tools such as diff when comparing similar configs
	
>How-To-Repeat:
	config -x /boot/kernel/kernel > t
	vi t
	:$
>Fix:

	

http://berklix.com/~jhs/src/bsd/fixes/FreeBSD/src/gen/usr.sbin/config/main.c.REL=ALL.diff


*** 7.0-PRERELEASE-src-7-ctm86/src/usr.sbin/config/main.c	Sat Jan 12 23:02:26 2008
--- new/src/usr.sbin/config/main.c	Sat Jan 12 23:10:48 2008
***************
*** 687,693 ****
  	r = fseek(fp, off, SEEK_CUR);
  	if (r != 0)
  		errx(EXIT_FAILURE, "fseek() failed");
! 	while ((r = fgetc(fp)) != EOF && size-- > 0)
  		fputc(r, stdout);
  	fclose(fp);
  }
--- 687,693 ----
  	r = fseek(fp, off, SEEK_CUR);
  	if (r != 0)
  		errx(EXIT_FAILURE, "fseek() failed");
! 	while ((r = fgetc(fp)) != EOF && ( r != '\0' ) && size-- > 0)
  		fputc(r, stdout);
  	fclose(fp);
  }
>Release-Note:
>Audit-Trail:
>Unformatted:



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