switch(operation) {
case NTT_ADD:
- if (nttlist == NULL) nttlist = strdoop("");
+ if (nttlist == NULL) nttlist = strdup("");
if (nttlist == NULL) break;
- nttlist = (char *)reallok(nttlist,
+ nttlist = (char *)realloc(nttlist,
(strlen(nttlist) + strlen(nodename) + 3) );
strcat(nttlist, "|");
strcat(nttlist, nodename);
case NTT_REMOVE:
if (nttlist == NULL) break;
if (strlen(nttlist) == 0) break;
- ptr = mallok(strlen(nttlist));
+ ptr = malloc(strlen(nttlist));
if (ptr == NULL) break;
strcpy(ptr, "");
for (i = 0; i < num_tokens(nttlist, '|'); ++i) {
strcat(ptr, "|");
}
}
- phree(nttlist);
+ free(nttlist);
nttlist = ptr;
break;
break;
}
- if (nttlist != NULL) lprintf(9, "nttlist=<%s>\n", nttlist);
+ if (nttlist != NULL) lprintf(CTDL_DEBUG, "nttlist=<%s>\n", nttlist);
end_critical_section(S_NTTLIST);
return(retval);
}
char newroom[SIZ];
char buf[SIZ];
int a;
- struct room qrbuf;
+ struct ctdlroom qrbuf;
extract(filename, cmdbuf, 0);
extract(newroom, cmdbuf, 1);
}
if (getroom(&qrbuf, newroom) != 0) {
- cprintf("%d '%s' does not exist.\n", ERROR, newroom);
+ cprintf("%d '%s' does not exist.\n", ERROR + ROOM_NOT_FOUND, newroom);
return;
}
if ((qrbuf.QRflags & QR_DIRECTORY) == 0) {
snprintf(newpath, sizeof newpath, "./files/%s/%s", qrbuf.QRdirname,
filename);
if (link(pathname, newpath) != 0) {
- cprintf("%d Couldn't move file: %s\n", ERROR,
+ cprintf("%d Couldn't move file: %s\n", ERROR + INTERNAL_ERROR,
strerror(errno));
return;
}
return;
}
snprintf(outfile, sizeof outfile,
- "%s/network/spoolin/nsf.%04x.%04x",
- BBSDIR, getpid(), ++seq);
+ "%s/network/spoolin/nsf.%04lx.%04x",
+ BBSDIR, (long)getpid(), ++seq);
ofp = fopen(outfile, "a");
if (ofp == NULL) {
- cprintf("%d internal error\n", ERROR);
+ cprintf("%d internal error\n", ERROR + INTERNAL_ERROR);
return;
}
if (CC->download_fp != NULL) {
cprintf("%d You already have a download file open.\n",
- ERROR);
+ ERROR + RESOURCE_BUSY);
return;
}
if (CC->download_fp == NULL) {
cprintf("%d cannot open %s: %s\n",
- ERROR, pathname, strerror(errno));
+ ERROR + INTERNAL_ERROR, pathname, strerror(errno));
return;
}
{
char filename[SIZ];
char pathname[SIZ];
- struct user usbuf;
+ struct ctdluser usbuf;
char which_user[USERNAME_SIZE];
int which_floor;
int a;
if (CC->download_fp != NULL) {
cprintf("%d You already have a download file open.\n",
- ERROR);
+ ERROR + RESOURCE_BUSY);
return;
}
if (CC->upload_fp != NULL) {
cprintf("%d You already have a upload file open.\n",
- ERROR);
+ ERROR + RESOURCE_BUSY);
return;
}
CC->upload_fp = fopen(CC->upl_path, "wb");
if (CC->upload_fp == NULL) {
cprintf("%d Cannot open %s: %s\n",
- ERROR, CC->upl_path, strerror(errno));
+ ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
return;
}
cprintf("%d Ok\n", CIT_OK);
int a;
if (num_parms(cmdbuf) < 2) {
- cprintf("%d Usage error.\n", ERROR);
+ cprintf("%d Usage error.\n", ERROR + ILLEGAL_VALUE);
return;
}
extract(basenm, cmdbuf, 1);
if (CC->upload_fp != NULL) {
cprintf("%d You already have an upload file open.\n",
- ERROR);
+ ERROR + RESOURCE_BUSY);
return;
}
CC->upload_fp = fopen(CC->upl_path, "wb");
if (CC->upload_fp == NULL) {
cprintf("%d Cannot open %s: %s\n",
- ERROR, CC->upl_path, strerror(errno));
+ ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
return;
}
cprintf("%d Ok\n", CIT_OK);
if (CC->download_fp == NULL) {
cprintf("%d You don't have a download file open.\n",
- ERROR);
+ ERROR + RESOURCE_NOT_OPEN);
return;
}
char upload_notice[512];
if (CC->upload_fp == NULL) {
- cprintf("%d You don't have an upload file open.\n", ERROR);
+ cprintf("%d You don't have an upload file open.\n", ERROR + RESOURCE_NOT_OPEN);
return;
}
if (CC->download_fp == NULL) {
cprintf("%d You don't have a download file open.\n",
- ERROR);
+ ERROR + RESOURCE_NOT_OPEN);
return;
}
bytes = extract_int(cmdbuf, 0);
if (CC->upload_fp == NULL) {
- cprintf("%d You don't have an upload file open.\n", ERROR);
+ cprintf("%d You don't have an upload file open.\n", ERROR + RESOURCE_NOT_OPEN);
return;
}
if (bytes > 4096) {
cprintf("%d You may not write more than 4096 bytes.\n",
- ERROR);
+ ERROR + TOO_BIG);
return;
}
if (CC->download_fp != NULL) {
cprintf("%d You already have a download file open.\n",
- ERROR);
+ ERROR + RESOURCE_BUSY);
return;
}
CC->download_fp = fopen(pathname, "r");
if (CC->download_fp == NULL) {
cprintf("%d cannot open %s: %s\n",
- ERROR, pathname, strerror(errno));
+ ERROR + INTERNAL_ERROR, pathname, strerror(errno));
return;
}
if (CC->upload_fp != NULL) {
cprintf("%d You already have an upload file open.\n",
- ERROR);
+ ERROR + RESOURCE_BUSY);
return;
}
snprintf(CC->upl_path, sizeof CC->upl_path,
- "%s/network/spoolin/%s.%04x.%04x",
- BBSDIR, CC->net_node, getpid(), ++seq);
+ "%s/network/spoolin/%s.%04lx.%04x",
+ BBSDIR, CC->net_node, (long)getpid(), ++seq);
CC->upload_fp = fopen(CC->upl_path, "r");
if (CC->upload_fp != NULL) {
CC->upload_fp = fopen(CC->upl_path, "w");
if (CC->upload_fp == NULL) {
cprintf("%d Cannot open %s: %s\n",
- ERROR, CC->upl_path, strerror(errno));
+ ERROR + INTERNAL_ERROR, CC->upl_path, strerror(errno));
return;
}