Skip to content

Commit

Permalink
FIND_PAR_S: include terminating 0 for string copy operation
Browse files Browse the repository at this point in the history
  • Loading branch information
FhGSpCo committed Apr 15, 2023
1 parent 184383a commit 1af4b74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions src/eid/gen-patt.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,9 +550,6 @@ int main (int argc, char *argv[]) {
}
}

/* initialize state_file with 0, to make sure the string is terminated with \0, which FIND_PAR_S () doesn't add */
memset(state_file, 0, sizeof(state_file));

/* Get command line parameters */
GET_PAR_S (1, "_Output bit stream file ...........................: ", data_file_name);
FIND_PAR_C (2, "_Processing mode (Random,Frame,Burst) [RFB] .......: ", mode, mode);
Expand Down
2 changes: 1 addition & 1 deletion src/utl/ugstdemo.h
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
fprintf (stderr,"%s%c\n",msg,C);}

#define FIND_PAR_S(p,msg,i,dft) \
{ memmove(i,(argc>p)?argv[p]:dft, strlen((argc>p)?argv[p]:dft));\
{ memmove(i,(argc>p)?argv[p]:dft, strlen((argc>p)?argv[p]:dft)+1);\
fprintf (stderr,"%s%s\n",msg,i); }

#define FIND_PAR_L(p,msg,i,j) \
Expand Down

0 comments on commit 1af4b74

Please sign in to comment.