diff --git a/src/input1.c b/src/input1.c index 3eb5585..1e59b80 100644 --- a/src/input1.c +++ b/src/input1.c @@ -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); diff --git a/src/input2.c b/src/input2.c index c40d029..717ef81 100644 --- a/src/input2.c +++ b/src/input2.c @@ -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); diff --git a/src/output.c b/src/output.c index b91ab83..a9ed2a8 100644 --- a/src/output.c +++ b/src/output.c @@ -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); diff --git a/src/types.h b/src/types.h index c2350d0..7b9358d 100755 --- a/src/types.h +++ b/src/types.h @@ -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