Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: David Mosberger-Tang <davidm@AZStarNet.com>
Subject: Re: _printf_  problem
Date: Tue, 6 Aug 1996 08:06:10 -0700	[thread overview]
Message-ID: <199608061506.IAA20823@panda.azstarnet.com> (raw)

>>>>> On Tue, 06 Aug 96 10:00:00 EDT, David Wild <dawild@symix.com> said:

  David> I finally tracked the problem down to this

  David>     time (&t); printf ("%s\n ", ctime (&t) + 4);

  David> The "+ 4" should move pointer so the output is looks like
  David> "Aug 6 08:43:16" instead of "Tue Aug 6 08:43:16".  Even
  David> though it compiles fine it will produce a memory violation
  David> when it gets run.  I have never seen this happen on any other
  David> platform.

  David> Does anybody have a clue as to why this is happening.

Both regular Red Hat 3.0.3 and GNU libc handle this correctly:

	$ cat t.c
	#include <time.h>

	int
	main(int argc, char ** argv)
	{
	    time_t t;

	    time (&t);
	    printf ("%s\n", ctime (&t) + 4);
	}
	$ gcc -O2 t.c
	$ ./a.out
	Aug  6 08:04:55 1996

	$

What distribution/libc version are you using?

	--david

--
To unsubscribe: mail -s unsubscribe axp-list-request@redhat.com < /dev/null

             reply	other threads:[~1996-08-06 15:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-08-06 15:06 David Mosberger-Tang [this message]
  -- strict thread matches above, loose matches on Subject: below --
1996-08-07 12:16 _printf_ problem David Wild
     [not found] <32075000@msmailgtwy.nvl.symix.com>
1996-08-06 23:37 ` Richard Henderson
1996-08-06 15:25 David Wild
1996-08-06 14:00 David Wild
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox