From: Jeffrey Altman Date: Wed, 27 Oct 2010 18:25:10 +0000 (-0400) Subject: don't duplicate work of ctime_s X-Git-Tag: upstream/1.8.0_pre1^2~4607 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=46cf6c8f365d25122c550b76be61a880d16f531b;p=packages%2Fo%2Fopenafs.git don't duplicate work of ctime_s 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 Tested-by: Derrick Brashear --- diff --git a/src/util/afsutil.h b/src/util/afsutil.h index 401d730be..e3fd362db 100644 --- a/src/util/afsutil.h +++ b/src/util/afsutil.h @@ -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; }