From owner-freebsd-questions Fri May 19 23: 7:23 2000 Delivered-To: freebsd-questions@freebsd.org Received: from rhenium.btinternet.com (rhenium.btinternet.com [194.73.73.93]) by hub.freebsd.org (Postfix) with ESMTP id 6282F37B55C for ; Fri, 19 May 2000 23:07:18 -0700 (PDT) (envelope-from mark@ukug.uk.freebsd.org) Received: from [213.1.153.139] (helo=parish.my.domain) by carbon with esmtp (Exim 2.05 #1) id 12syXV-0006JN-00; Sat, 20 May 2000 02:58:53 +0100 Received: (from mark@localhost) by parish.my.domain (8.9.3/8.9.3) id CAA00670; Sat, 20 May 2000 02:58:40 +0100 (BST) (envelope-from mark) Date: Sat, 20 May 2000 02:58:40 +0100 From: Mark Ovens To: Gustavo Vieira Goncalves Coelho Rios Cc: questions@freebsd.org Subject: Re: strange error Message-ID: <20000520025840.B252@parish> References: <3925C207.789AC2AA@tdnet.com.br> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0.1i In-Reply-To: <3925C207.789AC2AA@tdnet.com.br>; from kernel@tdnet.com.br on Fri, May 19, 2000 at 07:36:55PM -0300 Organization: Total lack of Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG On Fri, May 19, 2000 at 07:36:55PM -0300, Gustavo Vieira Goncalves Coelho Rios wrote: > What is the problem with this code. I simply can't figure out: > > > #include > #include > > char *a(char *); > void t(char *); > > /* You should call it with at least one parameters, ex: > ./a.out test > */ > > void > main(int argc, char *argv[]) > { > char *dir; > > ++argv; > printf("%s\n", *argv); > > dir = a(*argv); > t(dir); > > printf("%s\n", *dir); change that to printf("%s\n", dir); HTH > } > > > void > t(char *a) > { > while (*a) > *a++ = '1'; > } > > char * > a(char *b) > { > return strdup(b); > } > > -- > Your mouse has moved. > Windows NT must be restarted for the change to take effect! > > Reboot now? [ OK] > > > To Unsubscribe: send mail to majordomo@FreeBSD.org > with "unsubscribe freebsd-questions" in the body of the message -- ...and on the eighth day God created UNIX ________________________________________________________________ FreeBSD - The Power To Serve http://www.freebsd.org My Webpage http://ukug.uk.freebsd.org/~mark/ mailto:mark@ukug.uk.freebsd.org http://www.radan.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message