From f5d9592554715e3477e52dd9f557f4b72310b8c8 Mon Sep 17 00:00:00 2001 From: mccallum Date: Thu, 31 Oct 1996 20:05:02 +0000 Subject: [PATCH] ([NSCalendarDate -descriptionWithCalendarFormat:locale:]): Remove unused variables MS and DS. Avoid warning by not trying to sprintf() a zero-length string. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@1911 72102866-910b-0410-8b05-ffd578937521 --- Source/NSCalendarDate.m | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Source/NSCalendarDate.m b/Source/NSCalendarDate.m index fd8e52d9f..996efce36 100644 --- a/Source/NSCalendarDate.m +++ b/Source/NSCalendarDate.m @@ -524,7 +524,6 @@ const char *f = [format cString]; int lf = strlen(f); BOOL mtag = NO, dtag = NO, ycent = NO; - char ms[80] = "", ds[80] = ""; int yd = 0, md = 0, dd = 0, hd = 0, mnd = 0, sd = 0; int i, j, k; @@ -592,8 +591,12 @@ case 'm': ++i; if (mtag) - // +++ Translate to locale character string - k = sprintf(&(buf[j]), ""); + { + // +++ Translate to locale character string + /* was: k = sprintf(&(buf[j]), ""); */ + buf[j] = '\0'; + k = 0; + } else k = sprintf(&(buf[j]), "%02d", md); j += k; @@ -608,8 +611,12 @@ case 'w': ++i; if (dtag) - // +++ Translate to locale character string - k = sprintf(&(buf[j]), ""); + { + // +++ Translate to locale character string + /* Was: k = sprintf(&(buf[j]), ""); */ + buf[j] = '\0'; + k = 0; + } else k = sprintf(&(buf[j]), "%02d", dd); j += k;