From: Stephen Adams Date: Thu, 19 Aug 1993 22:19:29 +0000 (+0000) Subject: fixed FILE-TIME->STRING to check for a null string returned from X-Git-Tag: 20090517-FFI~8048 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=c66dc8a63873da288545071d91331774f1f45d29;p=mit-scheme.git fixed FILE-TIME->STRING to check for a null string returned from ctime(). This happens with the SDK C runtime library when the time is -1. The returned string is empty. --- diff --git a/v7/src/microcode/prntenv.c b/v7/src/microcode/prntenv.c index e990b4459..b3d6d71bf 100644 --- a/v7/src/microcode/prntenv.c +++ b/v7/src/microcode/prntenv.c @@ -1,6 +1,6 @@ /* -*-C-*- -$Id: prntenv.c,v 1.1 1993/06/24 06:57:57 gjr Exp $ +$Id: prntenv.c,v 1.2 1993/08/19 22:19:29 adams Exp $ Copyright (c) 1993 Massachusetts Institute of Technology @@ -46,9 +46,10 @@ DEFINE_PRIMITIVE ("FILE-TIME->STRING", Prim_file_time_to_string, 1, 1, PRIMITIVE_HEADER (1); CHECK_ARG (1, INTEGER_P); { - time_t clock = (arg_integer (1)); - char * time_string = (DOS_ctime (&clock)); - (time_string[24]) = '\0'; + time_t clock = arg_integer (1); + char * time_string = ctime (&clock); + if (time_string) + time_string[24] = '\0'; PRIMITIVE_RETURN (char_pointer_to_string ((unsigned char *) time_string)); } }