Increased size of MAXMSG to 255 (#189)

This commit is contained in:
Lew Rossman
2018-10-15 11:34:25 -04:00
parent 1c3044c948
commit 1fce14efb8
4 changed files with 10 additions and 9 deletions

View File

@@ -104,9 +104,9 @@ void setdefaults(EN_Project *pr)
time_options_t *time = &pr->time_options;
out_file_t *out = &pr->out_files;
strncpy(pr->Title[0], "", MAXMSG);
strncpy(pr->Title[1], "", MAXMSG);
strncpy(pr->Title[2], "", MAXMSG);
strncpy(pr->Title[0], "", TITLELEN);
strncpy(pr->Title[1], "", TITLELEN);
strncpy(pr->Title[2], "", TITLELEN);
strncpy(out->TmpDir, "", MAXFNAME);
strncpy(out->TmpFname, "", MAXFNAME);
strncpy(out->HydFname, "", MAXFNAME);

View File

@@ -292,7 +292,7 @@ int newline(EN_Project *pr, int sect, char *line)
n = (int)strlen(line);
if (line[n - 1] == 10)
line[n - 1] = ' ';
strncpy(pr->Title[par->Ntitle], line, MAXMSG);
strncpy(pr->Title[par->Ntitle], line, TITLELEN);
par->Ntitle++;
}
return (0);

View File

@@ -87,9 +87,9 @@ int savenetdata(EN_Project *pr)
fwrite(ibuf, sizeof(INT4), 15, outFile);
/* Write string variables to outFile */
fwrite(pr->Title[0], sizeof(char), MAXMSG + 1, outFile);
fwrite(pr->Title[1], sizeof(char), MAXMSG + 1, outFile);
fwrite(pr->Title[2], sizeof(char), MAXMSG + 1, outFile);
fwrite(pr->Title[0], sizeof(char), TITLELEN + 1, outFile);
fwrite(pr->Title[1], sizeof(char), TITLELEN + 1, outFile);
fwrite(pr->Title[2], sizeof(char), TITLELEN + 1, outFile);
fwrite(par->InpFname, sizeof(char), MAXFNAME + 1, outFile);
fwrite(rep->Rpt2Fname, sizeof(char), MAXFNAME + 1, outFile);
fwrite(qu->ChemName, sizeof(char), MAXID + 1, outFile);

View File

@@ -48,8 +48,9 @@ typedef int INT4;
#define ENGINE_VERSION 201
#define EOFMARK 0x1A /* Use 0x04 for UNIX systems */
#define MAXTITLE 3 /* Max. # title lines */
#define TITLELEN 79 // Max. # characters in a title line
#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 MAXFNAME 259 /* Max. # characters in file name */
#define MAXTOKS 40 /* Max. items per line of input */
@@ -900,7 +901,7 @@ typedef struct EN_Project {
Openflag, /// Toolkit open flag
Warnflag, /// Warning flag
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
error_handle_t* error_handle; //Simple error manager