Skip to content

Commit

Permalink
Try memcmp
Browse files Browse the repository at this point in the history
  • Loading branch information
John Eslick committed Aug 14, 2021
1 parent 855c835 commit 1be2e1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions petsc/petsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,10 @@ char **transform_args(int argc, char** argv, int *size){
int i=0, j=0, k=0, h=0; // another counter

for(i=0; i<argc; ++i){
if(strcmp(argv[i], "-v") == 0){
strcpy(argv2[i], "-version");
++k;
continue;
if(memcmp(argv[i], "-v", sizeof(char)*3) == 0){
memcpy(argv2[i], "-version", sizeof(char)*9);
++k;
continue;
}
for(j=0;argv[i][j]!='\0';++j){
if (j==0){
Expand Down

0 comments on commit 1be2e1c

Please sign in to comment.