Increased size of MAXMSG to 255 (#189)
This commit is contained in:
@@ -104,9 +104,9 @@ void setdefaults(EN_Project *pr)
|
|||||||
time_options_t *time = &pr->time_options;
|
time_options_t *time = &pr->time_options;
|
||||||
out_file_t *out = &pr->out_files;
|
out_file_t *out = &pr->out_files;
|
||||||
|
|
||||||
strncpy(pr->Title[0], "", MAXMSG);
|
strncpy(pr->Title[0], "", TITLELEN);
|
||||||
strncpy(pr->Title[1], "", MAXMSG);
|
strncpy(pr->Title[1], "", TITLELEN);
|
||||||
strncpy(pr->Title[2], "", MAXMSG);
|
strncpy(pr->Title[2], "", TITLELEN);
|
||||||
strncpy(out->TmpDir, "", MAXFNAME);
|
strncpy(out->TmpDir, "", MAXFNAME);
|
||||||
strncpy(out->TmpFname, "", MAXFNAME);
|
strncpy(out->TmpFname, "", MAXFNAME);
|
||||||
strncpy(out->HydFname, "", MAXFNAME);
|
strncpy(out->HydFname, "", MAXFNAME);
|
||||||
|
|||||||
@@ -292,7 +292,7 @@ int newline(EN_Project *pr, int sect, char *line)
|
|||||||
n = (int)strlen(line);
|
n = (int)strlen(line);
|
||||||
if (line[n - 1] == 10)
|
if (line[n - 1] == 10)
|
||||||
line[n - 1] = ' ';
|
line[n - 1] = ' ';
|
||||||
strncpy(pr->Title[par->Ntitle], line, MAXMSG);
|
strncpy(pr->Title[par->Ntitle], line, TITLELEN);
|
||||||
par->Ntitle++;
|
par->Ntitle++;
|
||||||
}
|
}
|
||||||
return (0);
|
return (0);
|
||||||
|
|||||||
@@ -87,9 +87,9 @@ int savenetdata(EN_Project *pr)
|
|||||||
fwrite(ibuf, sizeof(INT4), 15, outFile);
|
fwrite(ibuf, sizeof(INT4), 15, outFile);
|
||||||
|
|
||||||
/* Write string variables to outFile */
|
/* Write string variables to outFile */
|
||||||
fwrite(pr->Title[0], sizeof(char), MAXMSG + 1, outFile);
|
fwrite(pr->Title[0], sizeof(char), TITLELEN + 1, outFile);
|
||||||
fwrite(pr->Title[1], sizeof(char), MAXMSG + 1, outFile);
|
fwrite(pr->Title[1], sizeof(char), TITLELEN + 1, outFile);
|
||||||
fwrite(pr->Title[2], sizeof(char), MAXMSG + 1, outFile);
|
fwrite(pr->Title[2], sizeof(char), TITLELEN + 1, outFile);
|
||||||
fwrite(par->InpFname, sizeof(char), MAXFNAME + 1, outFile);
|
fwrite(par->InpFname, sizeof(char), MAXFNAME + 1, outFile);
|
||||||
fwrite(rep->Rpt2Fname, sizeof(char), MAXFNAME + 1, outFile);
|
fwrite(rep->Rpt2Fname, sizeof(char), MAXFNAME + 1, outFile);
|
||||||
fwrite(qu->ChemName, sizeof(char), MAXID + 1, outFile);
|
fwrite(qu->ChemName, sizeof(char), MAXID + 1, outFile);
|
||||||
|
|||||||
@@ -48,8 +48,9 @@ typedef int INT4;
|
|||||||
#define ENGINE_VERSION 201
|
#define ENGINE_VERSION 201
|
||||||
#define EOFMARK 0x1A /* Use 0x04 for UNIX systems */
|
#define EOFMARK 0x1A /* Use 0x04 for UNIX systems */
|
||||||
#define MAXTITLE 3 /* Max. # title lines */
|
#define MAXTITLE 3 /* Max. # title lines */
|
||||||
|
#define TITLELEN 79 // Max. # characters in a title line
|
||||||
#define MAXID 31 /* Max. # characters in ID name */
|
#define MAXID 31 /* Max. # characters in ID name */
|
||||||
#define MAXMSG 79 /* Max. # characters in message text */
|
#define MAXMSG 255 /* Max. # characters in message text */
|
||||||
#define MAXLINE 255 /* Max. # characters read from input line */
|
#define MAXLINE 255 /* Max. # characters read from input line */
|
||||||
#define MAXFNAME 259 /* Max. # characters in file name */
|
#define MAXFNAME 259 /* Max. # characters in file name */
|
||||||
#define MAXTOKS 40 /* Max. items per line of input */
|
#define MAXTOKS 40 /* Max. items per line of input */
|
||||||
@@ -900,7 +901,7 @@ typedef struct EN_Project {
|
|||||||
Openflag, /// Toolkit open flag
|
Openflag, /// Toolkit open flag
|
||||||
Warnflag, /// Warning flag
|
Warnflag, /// Warning flag
|
||||||
Msg[MAXMSG+1], /// General-purpose string: errors, messages
|
Msg[MAXMSG+1], /// General-purpose string: errors, messages
|
||||||
Title[MAXTITLE][MAXMSG+1], /// Problem title
|
Title[MAXTITLE][TITLELEN+1],/// Project title
|
||||||
MapFname[MAXFNAME+1]; /// Map file name
|
MapFname[MAXFNAME+1]; /// Map file name
|
||||||
|
|
||||||
error_handle_t* error_handle; //Simple error manager
|
error_handle_t* error_handle; //Simple error manager
|
||||||
|
|||||||
Reference in New Issue
Block a user