Skip to content
Snippets Groups Projects
Commit a6a146f8 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Change qhub_t mode and days to an unsigned 8-bit int

Resolve the QWKnet hub 'days' key in msgs.ini being written as -1
parent 01c6034b
No related branches found
No related tags found
No related merge requests found
......@@ -54,7 +54,7 @@ bool new_qhub_sub(qhub_t* qhub, unsigned subnum, sub_t* sub, unsigned confnum)
{
if((qhub->sub=realloc(qhub->sub, sizeof(*qhub->sub)*(qhub->subs+1)))==NULL
|| (qhub->conf=(ushort *)realloc(qhub->conf, sizeof(*qhub->conf)*(qhub->subs+1)))==NULL
|| (qhub->mode=(char *)realloc(qhub->mode, sizeof(*qhub->mode)*(qhub->subs+1)))==NULL) {
|| (qhub->mode=(uchar *)realloc(qhub->mode, sizeof(*qhub->mode)*(qhub->subs+1)))==NULL) {
/* ToDo: report error */
return false;
}
......
......@@ -320,11 +320,11 @@ typedef struct { /* Generic Timed Event */
typedef struct { /* QWK Network Hub */
char id[LEN_QWKID+1], /* System ID of Hub */
*mode, /* Mode for Ctrl-A codes for ea. sub */
days, /* Days to call-out on */
call[LEN_CMD+1], /* Call-out command line to execute */
pack[LEN_CMD+1], /* Packing command line */
unpack[LEN_CMD+1]; /* Unpacking command line */
uint8_t *mode, /* Mode for Ctrl-A codes for ea. sub */
days; /* Days to call-out on */
char fmt[MAX_FILEEXT_LEN+1]; /* Archive format */
uint16_t time, /* Time to call-out */
node, /* Node to do the call-out */
......
......@@ -531,7 +531,7 @@ BOOL read_msgs_cfg(scfg_t* cfg, char* error, size_t maxerrlen)
return allocerr(error, maxerrlen, fname, "qhub sub", sizeof(sub_t)*k);
if((cfg->qhub[i]->conf=(ushort *)malloc(sizeof(ushort)*k))==NULL)
return allocerr(error, maxerrlen, fname, "qhub conf", sizeof(ushort)*k);
if((cfg->qhub[i]->mode=(char *)malloc(sizeof(char)*k))==NULL)
if((cfg->qhub[i]->mode=(uchar *)malloc(sizeof(uchar)*k))==NULL)
return allocerr(error, maxerrlen, fname, "qhub mode", sizeof(uchar)*k);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment