Skip to content

Commit

Permalink
lib/imagery: fix -Wfortify-source warning (OSGeo#2663)
Browse files Browse the repository at this point in the history
Addresses following compiler warning message:

warning: 'fscanf' may overflow; destination buffer in argument 3 has
size 1024, but the corresponding specifier may require size 1025
  • Loading branch information
nilason authored and marisn committed May 18, 2023
1 parent fbbd3e8 commit 5403745
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/imagery/sigset.c
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ static int get_title(FILE * fd, struct SigSet *S)
char title[1024];

*title = 0;
if (fscanf(fd, "%1024[^\n]", title) != 1)
if (fscanf(fd, "%1023[^\n]", title) != 1)
return -1;
G_strip(title);
I_SetSigTitle(S, title);
Expand Down Expand Up @@ -293,7 +293,7 @@ static int get_classtitle(FILE * fd, struct ClassSig *C)
char title[1024];

*title = 0;
if (fscanf(fd, "%1024[^\n]", title) != 1)
if (fscanf(fd, "%1023[^\n]", title) != 1)
return -1;
G_strip(title);
I_SetClassTitle(C, title);
Expand Down

0 comments on commit 5403745

Please sign in to comment.