From owner-freebsd-questions Wed Sep 19 5:53:15 2001 Delivered-To: freebsd-questions@freebsd.org Received: from gamma.root-servers.ch (gamma.root-servers.ch [195.49.62.126]) by hub.freebsd.org (Postfix) with SMTP id BC54637B411 for ; Wed, 19 Sep 2001 05:53:10 -0700 (PDT) Received: (qmail 23805 invoked from network); 19 Sep 2001 12:53:09 -0000 Received: from dclient217-162-128-224.hispeed.ch (HELO athlon550) (217.162.128.224) by 0 with SMTP; 19 Sep 2001 12:53:09 -0000 Date: Wed, 19 Sep 2001 14:56:55 +0200 From: Gabriel Ambuehl X-Mailer: The Bat! (v1.53bis) Educational Organization: BUZ Internet Services X-Priority: 3 (Normal) Message-ID: <152166323750.20010919145655@buz.ch> To: questions@freebsd.org Subject: ctime() and friends broken? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG -----BEGIN PGP SIGNED MESSAGE----- Hello, I'm trying to either use ctime() or strftime() to convert an int containing the seconds since the epoch to a human readable string, but so far, the only thing I get are segfaults: #include #include int main() { char timestr[40]; ctime_r((time_t *) time(NULL), timestr); printf("Time: %s\n", timestr); return 0; } Will result in a segfault and nothing else. The same happens when I try to feed the int to gmtime() so I could use the resulting struct tm as input to strftime(). What am I doing wrong (4.4RC)? Best regards, Gabriel J -----BEGIN PGP SIGNATURE----- Version: PGP 6.5i iQEVAwUBO6iICsZa2WpymlDxAQFdgAgAjnqUZSLdam2dJDOESXeRIaBOzbdN+6eK ZR1jUlmUP81dfiN9xcuoJC8+Lxv2lA/MsaDo7dRJmKfo1GcdTx4rDouzl1zTHVWH 1i+AhNfXAnJMjhIIPWXF/dl90H0V3haMXcC0Bvjr/sr0O7kY2FP5FPfxVp1VVlo0 1IYK2CAu1t1UHAL/prF04xGB3Jr5jpWr3TfvZsK7HqZgTBkk0gfLCrNeGf4kLJtd 7+N4hX1aRMT6/JskkI0FD/UuXD0CIrQcv6PoMY+uTo3RLF8KkF7bFaSeU6x0SgnS sICXqjAtW2NLToMg5mBywME9B2l6RUDOdSMZqZuaIBdbpI3jsBSbYg== =6JIB -----END PGP SIGNATURE----- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message