Skip to content

Commit

Permalink
Fix for string length in fscanf.
Browse files Browse the repository at this point in the history
  • Loading branch information
lars2015 committed Jan 17, 2025
1 parent 5cf8816 commit 577be27
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/formod.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ int main(

/* Loop over directories... */
char wrkdir[LEN];
while (fscanf(in, "%s", wrkdir) != EOF) {
while (fscanf(in, "%4999s", wrkdir) != EOF) {

/* Write info... */
LOG(1, "\nWorking directory: %s", wrkdir);
Expand Down
2 changes: 1 addition & 1 deletion src/retrieval.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ int main(
ERRMSG("Cannot open directory list!");

/* Loop over directories... */
while (fscanf(dirlist, "%s", ret.dir) != EOF) {
while (fscanf(dirlist, "%4999s", ret.dir) != EOF) {

/* Write info... */
LOG(1, "\nRetrieve in directory %s...\n", ret.dir);
Expand Down

0 comments on commit 577be27

Please sign in to comment.