Fixed date input

This commit is contained in:
Michiel Broek 2005-08-30 18:26:49 +00:00
parent 5d57dad57a
commit 68ab3f4eef

View File

@ -535,8 +535,8 @@ void Getnum(char *sStr, int iMaxlen)
*/ */
void GetDate(char *sStr, int iMaxlen) void GetDate(char *sStr, int iMaxlen)
{ {
unsigned char ch = 0; unsigned char ch = 0;
int iPos = 0; int iPos = 0;
FLUSHIN(); FLUSHIN();
strcpy(sStr, ""); strcpy(sStr, "");
@ -567,7 +567,7 @@ void GetDate(char *sStr, int iMaxlen)
PUTCHAR(ch); PUTCHAR(ch);
if (iPos == 2 || iPos == 5) { if (iPos == 2 || iPos == 5) {
PUTCHAR('-'); PUTCHAR('-');
snprintf(sStr + strlen(sStr), 1, "-"); snprintf(sStr + strlen(sStr), 2, "-");
iPos++; iPos++;
} }
} else } else