Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 01 Dec 1998 00:05:39 +0900
From:      Hidetoshi Shimokawa <simokawa@sat.t.u-tokyo.ac.jp>
To:        freebsd-alpha@FreeBSD.ORG
Subject:   /usr/bin/mail
Message-ID:  <19981201000539V.simokawa@sat.t.u-tokyo.ac.jp>

next in thread | raw e-mail | index | archive | help
Next, a patch to prevent /usr/bin/mail from unaligned access, obtained
from NetBSD.

/\ Hidetoshi Shimokawa
\/  simokawa@sat.t.u-tokyo.ac.jp
PGP public key: finger -l simokawa@sat.t.u-tokyo.ac.jp


Index: strings.c
===================================================================
RCS file: /pub/FreeBSD-CVS/src/usr.bin/mail/strings.c,v
retrieving revision 1.1.1.1
diff -c -r1.1.1.1 strings.c
*** strings.c	1994/05/27 12:32:07	1.1.1.1
--- strings.c	1998/11/29 06:41:14
***************
*** 64,71 ****
  	int index;
  
  	s = size;
! 	s += 3;
! 	s &= ~03;
  	index = 0;
  	for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
  		if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s)
--- 64,71 ----
  	int index;
  
  	s = size;
! 	s += (sizeof (char *) - 1);
! 	s &= ~(sizeof (char *) - 1);
  	index = 0;
  	for (sp = &stringdope[0]; sp < &stringdope[NSPACE]; sp++) {
  		if (sp->s_topFree == NOSTR && (STRINGSIZE << index) >= s)

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



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