From owner-freebsd-hackers Sun Mar 17 01:05:34 1996 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id BAA01269 for hackers-outgoing; Sun, 17 Mar 1996 01:05:34 -0800 (PST) Received: from irz301.inf.tu-dresden.de (irz301.inf.tu-dresden.de [141.76.1.11]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id BAA01257 for ; Sun, 17 Mar 1996 01:05:29 -0800 (PST) Received: from sax.sax.de by irz301.inf.tu-dresden.de (8.6.12/8.6.12-s1) with ESMTP id KAA22774; Sun, 17 Mar 1996 10:05:15 +0100 Received: by sax.sax.de (8.6.11/8.6.12-s1) with UUCP id KAA20973; Sun, 17 Mar 1996 10:05:14 +0100 Received: (from j@localhost) by uriah.heep.sax.de (8.7.4/8.6.9) id JAA10023; Sun, 17 Mar 1996 09:32:12 +0100 (MET) From: J Wunsch Message-Id: <199603170832.JAA10023@uriah.heep.sax.de> Subject: Re: core dump in tr To: freebsd-hackers@freebsd.org (FreeBSD hackers) Date: Sun, 17 Mar 1996 09:32:11 +0100 (MET) Cc: serg@bcs1.bcs.zaporizhzhe.ua (Sergey Shkonda) Reply-To: joerg_wunsch@uriah.heep.sax.de (Joerg Wunsch) In-Reply-To: <199603162027.AA01477@bcs1.bcs.zaporizhzhe.ua> from "Sergey Shkonda" at Mar 16, 96 10:27:44 pm X-Phone: +49-351-2012 669 X-Mailer: ELM [version 2.4 PL24 ME8a] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk As Sergey Shkonda wrote: > > Try tr "A-B" "C-D" > > ( A, B, C, D > 127 ) > ! u_char *str; /* user's string */ Thanks for pointing this out. It didn't dump core for me, but nevertheless, it didn't do what it was supposed to either. I've modified your suggested fix. The data type of any `char' that holds a real string (as opposed to random byte-sized binary garbage) should really be `char' (neither explicitly signed nor unsigned), but before assigning it to an int or compare it with sign extension, it should be casted to `u_char' first. -- cheers, J"org joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE Never trust an operating system you don't have sources for. ;-)