Spelling.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@899 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
@@ -115,10 +115,10 @@
|
|||||||
#include <ttdef.h>
|
#include <ttdef.h>
|
||||||
#include <descrip.h>
|
#include <descrip.h>
|
||||||
struct IOSB {
|
struct IOSB {
|
||||||
short iosb$w_value;
|
short iosb$w_value;
|
||||||
short iosb$w_count;
|
short iosb$w_count;
|
||||||
long iosb$l_info;
|
long iosb$l_info;
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef NX509_SIG
|
#ifndef NX509_SIG
|
||||||
@@ -149,246 +149,246 @@ static void (*savsig[NX509_SIG])();
|
|||||||
static jmp_buf save;
|
static jmp_buf save;
|
||||||
|
|
||||||
int des_read_password(key, prompt, verify)
|
int des_read_password(key, prompt, verify)
|
||||||
des_cblock (*key);
|
des_cblock (*key);
|
||||||
char *prompt;
|
char *prompt;
|
||||||
int verify;
|
int verify;
|
||||||
{
|
{
|
||||||
int ok;
|
int ok;
|
||||||
char buf[BUFSIZ],buff[BUFSIZ];
|
char buf[BUFSIZ],buff[BUFSIZ];
|
||||||
|
|
||||||
if ((ok=read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
|
if ((ok=read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
|
||||||
des_string_to_key(buf,key);
|
des_string_to_key(buf,key);
|
||||||
memset(buf,0,BUFSIZ);
|
memset(buf,0,BUFSIZ);
|
||||||
memset(buff,0,BUFSIZ);
|
memset(buff,0,BUFSIZ);
|
||||||
return(ok);
|
return(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
int des_read_2passwords(key1, key2, prompt, verify)
|
int des_read_2passwords(key1, key2, prompt, verify)
|
||||||
des_cblock (*key1);
|
des_cblock (*key1);
|
||||||
des_cblock (*key2);
|
des_cblock (*key2);
|
||||||
char *prompt;
|
char *prompt;
|
||||||
int verify;
|
int verify;
|
||||||
{
|
{
|
||||||
int ok;
|
int ok;
|
||||||
char buf[BUFSIZ],buff[BUFSIZ];
|
char buf[BUFSIZ],buff[BUFSIZ];
|
||||||
|
|
||||||
if ((ok=read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
|
if ((ok=read_pw(buf,buff,BUFSIZ,prompt,verify)) == 0)
|
||||||
des_string_to_2keys(buf,key1,key2);
|
des_string_to_2keys(buf,key1,key2);
|
||||||
memset(buf,0,BUFSIZ);
|
memset(buf,0,BUFSIZ);
|
||||||
memset(buff,0,BUFSIZ);
|
memset(buff,0,BUFSIZ);
|
||||||
return(ok);
|
return(ok);
|
||||||
}
|
}
|
||||||
|
|
||||||
int des_read_pw_string(buf, length, prompt, verify)
|
int des_read_pw_string(buf, length, prompt, verify)
|
||||||
char *buf;
|
char *buf;
|
||||||
int length;
|
int length;
|
||||||
char *prompt;
|
char *prompt;
|
||||||
int verify;
|
int verify;
|
||||||
{
|
{
|
||||||
char buff[BUFSIZ];
|
char buff[BUFSIZ];
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret=read_pw(buf,buff,(length>BUFSIZ)?BUFSIZ:length,prompt,verify);
|
ret=read_pw(buf,buff,(length>BUFSIZ)?BUFSIZ:length,prompt,verify);
|
||||||
memset(buff,0,BUFSIZ);
|
memset(buff,0,BUFSIZ);
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void read_till_nl(in)
|
static void read_till_nl(in)
|
||||||
FILE *in;
|
FILE *in;
|
||||||
{
|
{
|
||||||
#define SIZE 4
|
#define SIZE 4
|
||||||
char buf[SIZE+1];
|
char buf[SIZE+1];
|
||||||
|
|
||||||
do {
|
do {
|
||||||
fgets(buf,SIZE,in);
|
fgets(buf,SIZE,in);
|
||||||
} while (strchr(buf,'\n') == NULL);
|
} while (strchr(buf,'\n') == NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* return 0 if ok, 1 (or -1) otherwise */
|
/* return 0 if ok, 1 (or -1) otherwise */
|
||||||
static int read_pw(buf, buff, size, prompt, verify)
|
static int read_pw(buf, buff, size, prompt, verify)
|
||||||
char *buf;
|
char *buf;
|
||||||
char *buff;
|
char *buff;
|
||||||
int size;
|
int size;
|
||||||
char *prompt;
|
char *prompt;
|
||||||
int verify;
|
int verify;
|
||||||
{
|
{
|
||||||
#ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
|
#ifdef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
|
||||||
return pwd_dialog(buf, size);
|
return pwd_dialog(buf, size);
|
||||||
#else /* !WIN32 */
|
#else /* !WIN32 */
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
struct IOSB iosb;
|
struct IOSB iosb;
|
||||||
$DESCRIPTOR(terminal,"TT");
|
$DESCRIPTOR(terminal,"TT");
|
||||||
long tty_orig[3], tty_new[3];
|
long tty_orig[3], tty_new[3];
|
||||||
long status;
|
long status;
|
||||||
unsigned short channel = 0;
|
unsigned short channel = 0;
|
||||||
#else
|
#else
|
||||||
#ifndef MSDOS
|
#ifndef MSDOS
|
||||||
TTY_STRUCT tty_orig,tty_new;
|
TTY_STRUCT tty_orig,tty_new;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
int number=5;
|
int number=5;
|
||||||
int ok=0;
|
int ok=0;
|
||||||
int ps=0;
|
int ps=0;
|
||||||
FILE *tty=NULL;
|
FILE *tty=NULL;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
#ifndef MSDOS
|
#ifndef MSDOS
|
||||||
if ((tty=fopen("/dev/tty","r")) == NULL)
|
if ((tty=fopen("/dev/tty","r")) == NULL)
|
||||||
tty=stdin;
|
tty=stdin;
|
||||||
#else /* MSDOS */
|
#else /* MSDOS */
|
||||||
if ((tty=fopen("con","r")) == NULL)
|
if ((tty=fopen("con","r")) == NULL)
|
||||||
tty=stdin;
|
tty=stdin;
|
||||||
#endif /* MSDOS */
|
#endif /* MSDOS */
|
||||||
|
|
||||||
#if defined(TTY_get) && !defined(VMS)
|
#if defined(TTY_get) && !defined(VMS)
|
||||||
if (TTY_get(fileno(tty),&tty_orig) == -1)
|
if (TTY_get(fileno(tty),&tty_orig) == -1)
|
||||||
return(-1);
|
return(-1);
|
||||||
memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
|
memcpy(&(tty_new),&(tty_orig),sizeof(tty_orig));
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
status = SYS$ASSIGN(&terminal,&channel,0,0);
|
status = SYS$ASSIGN(&terminal,&channel,0,0);
|
||||||
if (status != SS$_NORMAL)
|
if (status != SS$_NORMAL)
|
||||||
return(-1);
|
return(-1);
|
||||||
status=SYS$QIOW(0,channel,IO$_SENSEMODE,&iosb,0,0,tty_orig,12,0,0,0,0);
|
status=SYS$QIOW(0,channel,IO$_SENSEMODE,&iosb,0,0,tty_orig,12,0,0,0,0);
|
||||||
if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
|
if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
|
||||||
return(-1);
|
return(-1);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (setjmp(save))
|
if (setjmp(save))
|
||||||
{
|
{
|
||||||
ok=0;
|
ok=0;
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
pushsig();
|
pushsig();
|
||||||
ps=1;
|
ps=1;
|
||||||
|
|
||||||
#ifdef TTY_FLAGS
|
#ifdef TTY_FLAGS
|
||||||
tty_new.TTY_FLAGS &= ~ECHO;
|
tty_new.TTY_FLAGS &= ~ECHO;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(TTY_set) && !defined(VMS)
|
#if defined(TTY_set) && !defined(VMS)
|
||||||
if (TTY_set(fileno(tty),&tty_new) == -1)
|
if (TTY_set(fileno(tty),&tty_new) == -1)
|
||||||
return(-1);
|
return(-1);
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
tty_new[0] = tty_orig[0];
|
tty_new[0] = tty_orig[0];
|
||||||
tty_new[1] = tty_orig[1] | TT$M_NOECHO;
|
tty_new[1] = tty_orig[1] | TT$M_NOECHO;
|
||||||
tty_new[2] = tty_orig[2];
|
tty_new[2] = tty_orig[2];
|
||||||
status = SYS$QIOW(0,channel,IO$_SETMODE,&iosb,0,0,tty_new,12,0,0,0,0);
|
status = SYS$QIOW(0,channel,IO$_SETMODE,&iosb,0,0,tty_new,12,0,0,0,0);
|
||||||
if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
|
if ((status != SS$_NORMAL) || (iosb.iosb$w_value != SS$_NORMAL))
|
||||||
return(-1);
|
return(-1);
|
||||||
#endif
|
#endif
|
||||||
ps=2;
|
ps=2;
|
||||||
|
|
||||||
while ((!ok) && (number--))
|
while ((!ok) && (number--))
|
||||||
|
{
|
||||||
|
fputs(prompt,stderr);
|
||||||
|
fflush(stderr);
|
||||||
|
|
||||||
|
buf[0]='\0';
|
||||||
|
fgets(buf,size,tty);
|
||||||
|
if (feof(tty)) goto error;
|
||||||
|
if ((p=(char *)strchr(buf,'\n')) != NULL)
|
||||||
|
*p='\0';
|
||||||
|
else read_till_nl(tty);
|
||||||
|
if (verify)
|
||||||
{
|
{
|
||||||
fputs(prompt,stderr);
|
fprintf(stderr,"\nVerifying password %s",prompt);
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
|
buff[0]='\0';
|
||||||
buf[0]='\0';
|
fgets(buff,size,tty);
|
||||||
fgets(buf,size,tty);
|
if (feof(tty)) goto error;
|
||||||
if (feof(tty)) goto error;
|
if ((p=(char *)strchr(buff,'\n')) != NULL)
|
||||||
if ((p=(char *)strchr(buf,'\n')) != NULL)
|
|
||||||
*p='\0';
|
*p='\0';
|
||||||
else read_till_nl(tty);
|
else read_till_nl(tty);
|
||||||
if (verify)
|
|
||||||
{
|
|
||||||
fprintf(stderr,"\nVerifying password %s",prompt);
|
|
||||||
fflush(stderr);
|
|
||||||
buff[0]='\0';
|
|
||||||
fgets(buff,size,tty);
|
|
||||||
if (feof(tty)) goto error;
|
|
||||||
if ((p=(char *)strchr(buff,'\n')) != NULL)
|
|
||||||
*p='\0';
|
|
||||||
else read_till_nl(tty);
|
|
||||||
|
|
||||||
if (strcmp(buf,buff) != 0)
|
if (strcmp(buf,buff) != 0)
|
||||||
{
|
{
|
||||||
fprintf(stderr,"\nVerify failure");
|
fprintf(stderr,"\nVerify failure");
|
||||||
fflush(stderr);
|
fflush(stderr);
|
||||||
break;
|
break;
|
||||||
/* continue; */
|
/* continue; */
|
||||||
}
|
|
||||||
}
|
}
|
||||||
ok=1;
|
|
||||||
}
|
}
|
||||||
|
ok=1;
|
||||||
|
}
|
||||||
|
|
||||||
error:
|
error:
|
||||||
fprintf(stderr,"\n");
|
fprintf(stderr,"\n");
|
||||||
/* What can we do if there is an error? */
|
/* What can we do if there is an error? */
|
||||||
#if defined(TTY_set) && !defined(VMS)
|
#if defined(TTY_set) && !defined(VMS)
|
||||||
if (ps >= 2) TTY_set(fileno(tty),&tty_orig);
|
if (ps >= 2) TTY_set(fileno(tty),&tty_orig);
|
||||||
#endif
|
#endif
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
if (ps >= 2)
|
if (ps >= 2)
|
||||||
status = SYS$QIOW(0,channel,IO$_SETMODE,&iosb,0,0
|
status = SYS$QIOW(0,channel,IO$_SETMODE,&iosb,0,0
|
||||||
,tty_orig,12,0,0,0,0);
|
,tty_orig,12,0,0,0,0);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (ps >= 1) popsig();
|
if (ps >= 1) popsig();
|
||||||
if (stdin != tty) fclose(tty);
|
if (stdin != tty) fclose(tty);
|
||||||
#ifdef VMS
|
#ifdef VMS
|
||||||
status = SYS$DASSGN(channel);
|
status = SYS$DASSGN(channel);
|
||||||
#endif
|
#endif
|
||||||
return(!ok);
|
return(!ok);
|
||||||
#endif /* !WIN32 */
|
#endif /* !WIN32 */
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
|
#ifndef WIN32 /* Visual C++ 4.0 (Windows95/NT) */
|
||||||
static void pushsig()
|
static void pushsig()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=1; i<NX509_SIG; i++)
|
for (i=1; i<NX509_SIG; i++)
|
||||||
savsig[i]=signal(i,recsig);
|
savsig[i]=signal(i,recsig);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void popsig()
|
static void popsig()
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i=1; i<NX509_SIG; i++)
|
for (i=1; i<NX509_SIG; i++)
|
||||||
signal(i,savsig[i]);
|
signal(i,savsig[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void recsig(i)
|
static void recsig(i)
|
||||||
int i;
|
int i;
|
||||||
{
|
{
|
||||||
longjmp(save,1);
|
longjmp(save,1);
|
||||||
#ifdef LINT
|
#ifdef LINT
|
||||||
i=i;
|
i=i;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* !WIN32 */
|
#endif /* !WIN32 */
|
||||||
|
|
||||||
#ifdef MSDOS
|
#ifdef MSDOS
|
||||||
static int noecho_fgets(buf,size,tty)
|
static int noecho_fgets(buf,size,tty)
|
||||||
char *buf;
|
char *buf;
|
||||||
int size;
|
int size;
|
||||||
FILE *tty;
|
FILE *tty;
|
||||||
{
|
{
|
||||||
int i,n;
|
int i,n;
|
||||||
char *p;
|
char *p;
|
||||||
|
|
||||||
p=buf;
|
p=buf;
|
||||||
for (;;)
|
for (;;)
|
||||||
|
{
|
||||||
|
if (size == 0)
|
||||||
{
|
{
|
||||||
if (size == 0)
|
*p='\0';
|
||||||
{
|
break;
|
||||||
*p='\0';
|
}
|
||||||
break;
|
size--;
|
||||||
}
|
i=getch();
|
||||||
size--;
|
if (i == '\r') i='\n';
|
||||||
i=getch();
|
*(p++)=i;
|
||||||
if (i == '\r') i='\n';
|
if (i == '\n')
|
||||||
*(p++)=i;
|
{
|
||||||
if (i == '\n')
|
*p='\0';
|
||||||
{
|
break;
|
||||||
*p='\0';
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return(strlen(buf));
|
|
||||||
}
|
}
|
||||||
|
return(strlen(buf));
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 1995, 1996 Kungliga Tekniska Hoegskolan (Royal Institute
|
* Copyright (c) 1995, 1996 Kungliga Tekniska H<EFBFBD>gskolan (Royal Institute
|
||||||
* of Technology, Stockholm, Sweden).
|
* of Technology, Stockholm, Sweden).
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
* 3. All advertising materials mentioning features or use of this software
|
* 3. All advertising materials mentioning features or use of this software
|
||||||
* must display the following acknowledgement:
|
* must display the following acknowledgement:
|
||||||
* This product includes software developed by the Kungliga Tekniska
|
* This product includes software developed by the Kungliga Tekniska
|
||||||
* Hoegskolan and its contributors.
|
* H<EFBFBD>gskolan and its contributors.
|
||||||
*
|
*
|
||||||
* 4. Neither the name of the Institute nor the names of its contributors
|
* 4. Neither the name of the Institute nor the names of its contributors
|
||||||
* may be used to endorse or promote products derived from this software
|
* may be used to endorse or promote products derived from this software
|
||||||
|
Reference in New Issue
Block a user