summaryrefslogtreecommitdiff
path: root/unixio.c
diff options
context:
space:
mode:
Diffstat (limited to 'unixio.c')
-rw-r--r--unixio.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/unixio.c b/unixio.c
index 5dd7843..62b81c6 100644
--- a/unixio.c
+++ b/unixio.c
@@ -80,13 +80,13 @@ dodebug(int fc, UCHAR * label, UCHAR * sval, long nval) {
if (fc != DB_OPN && !xdebug)
return;
if (!label)
- label = "";
+ label = (UCHAR *)"";
switch (fc) { /* Function code */
case DB_OPN: /* Open debug log */
if (dp) fclose(dp);
- if (!*label) label = "debug.log";
- dp = fopen(label,"w");
+ if (!*label) label = (UCHAR *)"debug.log";
+ dp = fopen((char *)label,"w");
if (!dp) {
dp = stderr;
} else {
@@ -239,7 +239,7 @@ inchk(struct k_data * k) {
int
readpkt(struct k_data * k, UCHAR *p, int len, int fc) {
- int x, n, max;
+ int x, n;
short flag;
UCHAR c;
/*
@@ -251,7 +251,7 @@ readpkt(struct k_data * k, UCHAR *p, int len, int fc) {
version might be driven by the value of the packet-length field.
*/
#ifdef DEBUG
- char * p2;
+ UCHAR * p2;
#endif /* DEBUG */
#ifdef F_CTRLC
@@ -353,7 +353,7 @@ openfile(struct k_data * k, UCHAR * s, int mode) {
switch (mode) {
case 1: /* Read */
- if (!(ifile = fopen(s,"r"))) {
+ if (!(ifile = fopen((char *)s,"r"))) {
debug(DB_LOG,"openfile read error",s,0);
return(X_ERROR);
}
@@ -365,7 +365,7 @@ openfile(struct k_data * k, UCHAR * s, int mode) {
return(X_OK);
case 2: /* Write (create) */
- ofile = creat(s,0644);
+ ofile = creat((char *)s,0644);
if (ofile < 0) {
debug(DB_LOG,"openfile write error",s,0);
return(X_ERROR);
@@ -429,10 +429,10 @@ fileinfo(struct k_data * k,
buf[0] = '\0';
if (buflen < 18)
return(X_ERROR);
- if (stat(filename,&statbuf) < 0)
+ if (stat((char *)filename,&statbuf) < 0)
return(X_ERROR);
timestamp = localtime(&(statbuf.st_mtime));
- sprintf(buf,"%04d%02d%02d %02d:%02d:%02d",
+ sprintf((char *)buf,"%04d%02d%02d %02d:%02d:%02d",
timestamp->tm_year + 1900,
timestamp->tm_mon + 1,
timestamp->tm_mday,
@@ -453,7 +453,7 @@ fileinfo(struct k_data * k,
*/
if (!mode) { /* File type determination requested */
int isbinary = 1;
- fp = fopen(filename,"r"); /* Open the file for scanning */
+ fp = fopen((char *)filename,"r"); /* Open the file for scanning */
if (fp) {
int n = 0, count = 0;
char c, * p;
@@ -605,7 +605,7 @@ closefile(struct k_data * k, UCHAR c, int mode) {
(c == 'D')) { /* This file was incomplete */
if (k->filename) {
debug(DB_LOG,"deleting incomplete",k->filename,0);
- unlink(k->filename); /* Delete it. */
+ unlink((char *)k->filename); /* Delete it. */
}
}
break;
@@ -615,7 +615,7 @@ closefile(struct k_data * k, UCHAR c, int mode) {
return(rc);
}
-#ifdef DEBUG
+#ifdef SIMULATED_ERROR
int xerror() {
unsigned int x;
extern int errorrate; /* Fix this - NO EXTERNS */
@@ -626,4 +626,4 @@ int xerror() {
debug(DB_LOG,"ERROR",0,(x < errorrate));
return(x < errorrate);
}
-#endif /* DEBUG */
+#endif /* SIMULATED_ERROR */