don't duplicate work of ctime_s
authorJeffrey Altman <jaltman@your-file-system.com>
Wed, 27 Oct 2010 18:25:10 +0000 (14:25 -0400)
committerDerrick Brashear <shadow@dementia.org>
Wed, 27 Oct 2010 19:27:26 +0000 (12:27 -0700)
on windows we use ctime_s for ctim'ing to a buffer. except we
allocate an extra buffer. "uh"

Change-Id: Ic40583814d0e1d05d7c98cde09855c036045208e
Reviewed-on: http://gerrit.openafs.org/3174
Reviewed-by: Derrick Brashear <shadow@dementia.org>
Tested-by: Derrick Brashear <shadow@dementia.org>

src/util/afsutil.h

index 401d730..e3fd362 100644 (file)
@@ -104,10 +104,7 @@ afs_ctime(const time_t *C, char *B, size_t S) {
     strncpy(B, ctime(C), (S-1));
     B[S-1] = '\0';
 #else
-    char buf[32];
-    if (ctime_s(buf, sizeof(buf), C) ||
-        strncpy_s(B, S, buf, _TRUNCATE))
-         B[0] = '\0';
+    ctime_s(B, S, C);
 #endif
     return B;
 }